Setting HP to a Variable

Hi, I'm working on a somewhat customized battle system where all battlers influence 1 master HP bar of sorts.


Right now I have a common event that averages each side's members' HP and sets those to a variable. Those variables will be added to until they add to 1,000.


My question is, is there a way to set all battlers on each side's current HP to their respective variables? I tried to use $gameParty.members().setHp($gameVariables.value(n)) but that is returning an error for me. I think the "setHp" part is wrong, but I can't find a proper tag anywhere else. Am I on the right track?
$gameParty.members() gives you an array of ALL members.  So you can't use setHp on an array.  You need to iterate over each element of that array and call the setHp function for each one.
That worked out perfectly, thank you!
@Shaz, please don't double post. If necessary use the Edit button.

Spoiler
I'm just joking, please don't take this seriously.  😉



Going alongside the topic's intention, is there a way to assign a Parameter to another? Like if I want HP to be 3x Def, is that possible?
Please don't hijack someone else's topic to ask your own questions.  Start your own thread.

Original thread: https://forums.rpgmakerweb.com/threads/setting-hp-to-a-variable.62950/