Script command to get Actor 1 ATK as variable

Is it possibile to get the actor 1 ATK value and put it in a variable?

Is it also possible to change the actor 1 ATK value based on a variable's value?
you don't need a script for this - the control variable command can access all actor game data directly (just select the game data option and change it from "map ID" to "Actor 1 ATK")

and the second option can be done with the "change parameter" event command
If you really need it done via script call:
Code:
$gameActors.actor(actorId).atk
Will give you an actor atk parameter.

To add to an actor parameter via script call use:
Code:
$gameActors.actor(actorId).addParam(paramId,amount)
Replacing paramId by the index of the parameters (index is read from left to right in the class tab 0->mhp, 1->mmp, 2->atk,...,7->luk

To get a variable value via script call use:
Code:
$gameVariables.value(varId)

In this link you can find the script call equivalent of event commands.

As Andar said: if you don't absolutely need it done by script call, using the built in event commands is the safest way. Happy making!
Thank you!!!

Original thread: https://forums.rpgmakerweb.com/threads/script-command-to-get-actor-1-atk-as-variable.78634/