Adding variable after successful hits

Hey everyone, i'm using Yanfly's Buffs and States core.

http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/

I'm trying to use it in a way so when my character hits an enemy, it raises a variable. I'm making a character who gains stacks to use in a move. Here's how I have my state set up.


<Custom Confirm Effect>

// If current action deals HP damage...

if (this.isHpEffect() && value > 0) {

// ...set the bonus param damage

$gameVariables.value(15) += 15;

}

</Custom Confirm Effect>

But I keep getting this error when my player hits an enemy.

ReferenceError: Invalid left-hand side in assignment

Anyone know what i'm doing wrong?
Try changing:

Code:
$gameVariables.value(15) += 15;

For:

Code:
$gameVariables.setValue(15, $gameVariables.value(15) + 15);

o/
Try changing:

Code:
$gameVariables.value(15) += 15;

For:

Code:
$gameVariables.setValue(15, $gameVariables.value(15) + 15);

o/

Thanks for the fast response, it's working perfectly!

Original thread: https://forums.rpgmakerweb.com/threads/adding-variable-after-successful-hits.79564/