MV Have mp in action sequence effect the substitute target

As in the title, trying to figure out how to have the "mp -" sequence effect the substitute character instead of the originally targeted character.
Would I have to use an Eval statement instead?

video example



action sequence code

Code:
//Single target

<setup action>

      clear battle log

      display action

      immortal: targets, true

      perform start

      wait for movement

      cast animation

      wait for animation

    </setup action>



    <whole action>

    </whole action>



    <target action>

      wait: 6

      motion attack: user

      wait: 6

      action animation: target

      animation wait: 6

      wait for animation

    



action effect: target

if !target.result().missed && !target.result().evaded

wait: 12

change variable 3 =  Math.trunc($gameVariables.value(3) / 15) + Math.randomInt(2)

change variable 1 = user.level + Math.randomInt(2)

mp -variable 1: target,show

end

      wait for effect

    </target action>



    <follow action>

    </follow action>



    <finish action>

      immortal: targets, false

      wait for new line

      clear battle log

      perform finish

      wait for movement

      wait for effect

    </finish action>
bump
You could put it in the damage formula.
So if I add something like
b.gainMp(-(a.mat*4+b.mdf*2)); a.atk*4-b.def*2
at the end wont the hp and mp pop up happen at the same time, making it ineligible?
So if I add something like
b.gainMp(-(a.mat*4+b.mdf*2)); a.atk*4-b.def*2
at the end wont the hp and mp pop up happen at the same time, making it ineligible?
since you already provided the formula, the fastest way to see it is to try it
1701460035564.png

itll be faster seeing if it does what you want by trying it than asking if itll do what you want and waiting for a response. if it doesnt, then what to do from there is a good question to ask. if it does, the problems solved
since you already provided the formula, the fastest way to see it is to try it
View attachment 285977
itll be faster seeing if it does what you want by trying it than asking if itll do what you want and waiting for a response. if it doesnt, then what to do from there is a good question to ask. if it does, the problems solved
I've ran into similar issues like this before, which is why I was asking ahead of time since I was not able to test it at the time of writing.
So since everything in the the damage formula is executed at once it displays the hp and mp damage at the same time. I didn't see any reason why it wouldn't.
I'll check about adding an eval wait to the damage formula if that's possible.

1701525416029.png

Original thread: https://forums.rpgmakerweb.com/threads/have-mp-in-action-sequence-effect-the-substitute-target.163067/