Storing an Actors base stat and total stat in variable

So I have a system I want going where the player's on map movement speed is determined by the weight of the equipment they have on them. To do this, I'll have each equipment have a certain agility penalty. After that is where I'm stuck. I need to be able to store their base agility and total agility into separate variables. From there I can find the difference and determine a movement speed.


So, say Actor 1 has 30 agility after no changes made by equipment. So they are completely nekkid. I want to then store that agility score in variable 2. So say they equip some gear and the agility penalties drop their agility to 15. I want to then store that agility score into variable 3. However, since it is done dynamically in the background, it needs to check for base agility even when equipment is worn. This I do not know how to do.
by default the engine only give access to the total stats (control variable : game data).


To get the base numbers, you'll need to access the class and actor data directly by script.


I don't know the javascript code for that one, but I'm moving it in the correct forum for javascript coding so you can get the answer faster.


Then you need to enter that code into the script line of control variable.


I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.
Try this code for base agility 


$dataClasses[$gameActors.actor(1)._classId].params[6][$gameActors.actor(1).level]
Try this code for base agility 


$dataClasses[$gameActors.actor(1)._classId].params[6][$gameActors.actor(1).level]



That worked perfectly! Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/storing-an-actors-base-stat-and-total-stat-in-variable.67939/