MV how to save player stats

Hello, I am working on a script, within a common event I have managed to save the values of max HP, max MP, ATK, DEF etc. of an enemy in battle, however I don't know how to do this with the player's stats

below the script:
let nxtTrgt=$gameTroop.aliveMembers()[0]; $gameVariables.setValue(1,[nxtTrgt.mhp,nxtTrgt.mmp,nxtTrgt.atk,nxtTrgt.def,nxtTrgt.mat,nxtTrgt.mdf,nxtTrgt.agi]) let prota=$gameParty.members(0); <<<NOT WORK $gameVariables.setValue(2,[prota.mhp,prota.mmp,prota.atk,prota.def,prota.mat,prota.mdf,prota.agi]) <<<NOT WORK

I'm just getting started with scripting, so I'm not sure if "gameParty.members" is fine.
Thanks!!
you need to use: $gameParty.members()[0]
you need to use: $gameParty.members()[0]
THANKS!!
And do you have any idea how is the code to replace those values?
for example and tried with $gameParty.members()[0].setValue(agi,100);
but it does not work
.setValue agi,100 wont wont, but I dont know how to do that.
.name, and .level does work, but don't know about variables.

it has a different aproach, but I dont know how, still learning JS
on my own, but nothing battle related atm or that kind of things.
I have managed to do what I wanted with the following script:

let nxtTrgt=$gameTroop.aliveMembers()[0]; let prota=$gameParty.members()[0] $gameVariables.setValue(1,[nxtTrgt.mhp,nxtTrgt.mmp,nxtTrgt.atk,nxtTrgt.def,nxtTrgt.mat,nxtTrgt.mdf,nxtTrgt.agi]) $gameVariables.setValue(2,[prota.mhp,prota.mmp,prota.atk,prota.def,prota.mat,prota.mdf,prota.agi]) $gameActors.actor(0001).addParam(0, nxtTrgt.mhp-(prota.mhp)); $gameActors.actor(0001).addParam(1, nxtTrgt.mmp-(prota.mmp)); $gameActors.actor(0001).addParam(2, nxtTrgt.atk-(prota.atk)); $gameActors.actor(0001).addParam(3, nxtTrgt.def-(prota.def)); $gameActors.actor(0001).addParam(4, nxtTrgt.mat-(prota.mat)); $gameActors.actor(0001).addParam(5, nxtTrgt.mdf-(prota.mdf)); $gameActors.actor(0001).addParam(6, nxtTrgt.agi-(prota.agi));

Original thread: https://forums.rpgmakerweb.com/threads/how-to-save-player-stats.135298/