MV (SOLVED) (Yanfly) How do I get the magic attack of a caster that applied a state on a target?

I am trying to have the game get the magic attack of Battler A so that Battler B gets an amount of absorption barrier points every round that passes by from a custom state. I am using Yanfly's Absorption Barrier plugin and its
Code:
 <Custom Barrier Regen>
, but I don't know how to get Actor A's magic attack inside of the state's notetag. What is it that I am missing?
If you want to get the MAT of a specific actor you can get it via:
JavaScript:
$gameActors.actor(Actor ID).mat
If you're using Yanfly's Buffs & States, there's an included origin variable that tracks who created the state.

So the magic attack of the caster is simply origin.mat
To add on to @ATT_Turan, if you want to forcibly set the origin to a certain unit, you can also do something like this...
JavaScript:
<Pre-Damage Eval>
target.setStateOrigin(42, user);
</Pre-Damage Eval>
I have to do this because the origin is not set automatically w/ the battle system I'm using (LeTBS).
JavaScript:
<Pre-Damage Eval>
target.setStateOrigin(42, user);
</Pre-Damage Eval>

This is applied to the state notetag, right?
This is applied to the state notetag, right?
No, it goes in the skill that causes the state. The <Custom Execution> tag would also work, I reckon.
This is applied to the state notetag, right?
To be clear, unless you're using that specific, heavily modified battle system that Frostorm referred to, there is zero reason for you to use that code.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-yanfly-how-do-i-get-the-magic-attack-of-a-caster-that-applied-a-state-on-a-target.142749/