This third magic effect for MySpell has a script which is the effect that actually has tangible benefits and isn't a bunch of crap that I had to make to circumvent all these scripting limitations.
If all three magic effects are attached to the same spell (in your example, MySpell) then you don't need to store the target anywhere.
If you are using OnEffectStart(), then akTarget will be the same target you cast the spell on for every magic effect attached to that spell.
The Cast() funciton casts whatever spell instantly. The only requirement for Cast() is that the source object reference has the ability to cast the spell (under perfect circumstances COULD cast the spell, this is different from KNOWING the spell). It does not play any animation. The only requirement is that if the source is an actor that the actor be facing in the direction the spell is being cast().
http://www.creationkit.com/Cast_-_Spell
As for your question here, "trying to retrieve the actor reference of whatever NPC you cast a certain spell on last, so that a different spell can "target" that npc without aiming at it:"
FIRST Script
Scriptname MagicEffect1 Extends activemagiceffectActor Property MyTarget AutoEvent OnEffectStart(Actor akTarget, Actor akCaster);;does some things on this effect to akTargetMyTarget = akTarget((MyTarget as ObjectReference) as MagicEffect2).SetTarget(MyTarget)EndEvent
Note that this first script won't compile until after the second script has also been compiled as it relies on a function created in the second script.
Your SECOND Magic Effect script (different spell that can "target" that same NPC without aiming at it) will look like this:
Scriptname MagicEffect2 extends activemagiceffectActor Property MyTarget AutoFunction MyRef(Actor akActor)MyTarget = akActorEndFunctionEvent OnEffectStart(Actor akTarget, Actor akCaster)MyTarget.DoStuff() ;; <--- do stuff with the passed target from the first scriptEndEvent
The reason we don't use a variable in this instance is because you need the same property on both scripts in order for this to work.
Here is an example that I am using that works. The first script is the script that GETS the target. The second one receives the target property. I used this because you can't SetAlpha() on an actor using an OnLoad() event, as scripts attached to actors extend ObjectReference, not Actor.
Spoiler Scriptname RCQSpawnWolf extends activemagiceffect ActorBase Property Wolf Auto Actor Property RCQWolfActor Auto ;; <--- This is the property that is in use by BOTH scripts.GlobalVariable Property RCQWolfCounter AutoEffectShader Property RCQWolfShaderVar AutoEvent OnEffectStart(Actor target, Actor caster) if(RCQWolfCounter.GetValue() == 0) RCQWolfActor = Caster.PlaceActorAtMe(Wolf, 4) ((RCQWolfActor as ObjectReference) as RCQWolfShader).SetWolfActor(RCQWolfActor) ;; <-- This casts the ACTOR as an ObjRef as the second script (double casting, it's a little weird) and contains the function created in the second script. I can't use SetWolfActor() unless I call it on the script the function was created on (in this case, the name of the second script is RCQWolfShader). I cast my Actor as an ObjectRef as the second script name. This is extremely important. RCQWolfCounter.SetValue(1) EndIf EndEvent
Second script, sets the alpha level of the wolf placed in the first script. Since you can't SetAlpha() on an ObjectReference and the script, which is attached to the ObjectReference, can't call the actor it is attached to, I pass it the actor property from the previous script.
Spoiler Scriptname RCQWolfShader extends ObjectReference EffectShader Property RCQWolfSummonFXShader AutoActor Property RCQWolfActor AutoFloat Property AlphaValue = http://forums.bethsoft.com/topic/1361959-generic-questions/0.33 Autobool Property AlphaFade = False AutoFunction SetWolfActor(Actor akActor) RCQWolfActor = akActor EndFunction Event OnLoad()RCQWolfActor.SetAlpha(AlphaValue, AlphaFade)RCQWolfSummonFXShader.Play(self, -1.0)EndEvent
I hope this has made sense... it's a little tricky but once you've mastered this technique it will open up an entirely new world of Papyrus scripting for you. If I have confused you at all, please, feel free to ignore my post.

EDIT: Sorry - I misunderstood part of your question. The answer is yes, if you want to be able to call the target of the FIRST magic effect on your SECOND magic effect after the first magic effect has worn off you will have to store it as a property on a quest.