I want to create a new custom magic effect, using a Script archetype. I want to be able to add this effect to any arbitrary spell's Effect list, with a magnitude/duration. This same magnitude should affect the way the Papyrus script behaves.
Say, for example, I want to make a spell that increases the target's speed multiplier by X for Y seconds. My script would go something like:
ScriptName myEffect extends ActiveMagicEffectEvent OnEffectStart(Actor akTarget, Actor akCaster) akTarget.ModAV("SpeedMult", X)EndEvent
Now, I'm guessing that the ModAV call will make my effect go away when the duration is over, and I could use OnEffectFinish to clean up anything I start if I don't have a handy ModAV function, but I'm not sure. I also have no idea how to pass X into my script.