MZ Visustella Notetag that tracks damage dealt when under a certain state

Hello, I have been trying to get the Visustella JS Notetags system to save the damage dealt by an actor while under a certain state into a variable so that a move can later use it for a strong move. I have seen this thread and tried to incorporate their solution into my system but I suck at javascript and it doesn't work, anyone's got an idea ?
<JS Post-Damage as User>
target.damageDealt = target.damageDealt || 0;
target.damageDealt += value;
$gameVariables.addValue(4, $gameVariables.value(4)+value);
</JS Post-Damage as User>
Try this:
Code:
<JS Post-Damage as User>
$gameVariables.setValue(4, $gameVariables.value(4) + value);
</JS Post-Damage as User>
it worked ! thank you so much
You're welcome.

Original thread: https://forums.rpgmakerweb.com/threads/visustella-notetag-that-tracks-damage-dealt-when-under-a-certain-state.180148/