How do I set a Variable to be equal to an Actor's Stat using a Script?

Basically, I have a Common Event that needs to Perform a Skill Check and I'm trying to get the Ability Modifier for the Actor (which is a simple formula based on the Actor's requested Stat)





This Color Text means that I do not need help with this, and it's already accomplished
This Color Text means I need help with this.

- If the Actor has the Required Skill, that Actor's ID Is stored in a Variable.
- The appropriate Common Event is then called
- Each Common Event requires a Specific Stat's Ability Modifier

- Using the Actor's ID, I would like to store the Specific Stat into another Variable in order to use the formula for the Ability Modifier
 



WHAT I'M NOT LOOKING FOR:
I know how to assign a Stat for a SPECIFIC Actor inside a Variable, but this would require that I repeat this process for EVERY Party Member and EVERY Stat.

So I would like to set the Variable to a SCRIPT instead of a Game Operand.

WHAT I'M LOOKING FOR
I need the Script Command that brings up the requested Stat. It should be something like:

 

  • $gameActors.actor($gameVariables.value(X)).HP;
  • $gameActors.actor($gameVariables.value(x)).ATK;



But, apparently, that isn't it, because the value always returns as ZERO.

Thanks in advance,
Pixii
Something like this?


$gameActors.actor($gameVariables.value(x)).param(n);


Where x is the variable ID you want use, and n the parameter ID (0 = Hp, 1 = Mp, ...)
That's exactly what I was looking for, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-set-a-variable-to-be-equal-to-an-actors-stat-using-a-script.56600/