It is easy to set condition's for LOS on a spell or in the script I do that on all my spells so only the actors that the player sees run the scripts to reduce the resource over head in my Combat Archery Mod, but good luck intercepting the entry point for damage, AFAIK that can only be done in the perk system (not in scripts and not in spells) and it is impossible to dynamically give actors (except the player) perks. ALL the systems to do so are broken.
I will be overjoyed the day that perks can be added to actors dynamically in game (not in the CK).
I'm still very new with modding, and I'm having trouble doing this. I need to have scripts running on all potential targets so they can intercept hits and tweak the incoming damage based on some parameters, so I need to apply an effect on all of them with said script attached. I also need to know, at all times, the NPC closest to the player.
How would I go about doing this?