Yanfly Lunatic Code Help

I'm trying to replicate something like this:

-Fighter has the Combo passive.
-Every attack increases his Combo by 1.
-The more combo stacks he has the more damage his attacks do.
-If he does something other than attack like use a skill or item, the combo resets to 0.

I tried editing the code from here but to no avail.
I assume that you have Yanfly's Buffs and States Core and Auto Passive States plugins, so I hope this might help:

- Setup this state as your passive state. The combo state only works in battle and resets for each battle. For each combo stack, the damage increases by 50 for example:
Code:
<Custom Passive Condition>
//Check if your party is in battle to activate the state
if ($gameParty.inBattle()){
condition = true;}
else{
condition = false;
user._comboState = undefined;}
</Custom Passive Condition>

<Custom Battle Effect>
user._comboState = 0;
user.setStateCounter(x, user._comboState); //With X is your state ID. This will display the number of current stacks on your state
</Custom Battle Effect>

<Custom Confirm Effect>
//Check if the action is a normal attack
if (this.isAttack()){
//setup bonus dmg
var bonus = 50 * user._comboState;
//add bonus dmg to the current dmg
value += bonus;
//increase stack by 1
user._comboState += 1;}
else{
//if not an attack, reset the stack to 0
user._comboState = 0;}
user.setStateCounter(x, user._comboState); //With X is your state ID. This will display the number of current stacks on your state
</Custom Confirm Effect>

If this works and you need another way to increase the damage per stack, please let me know.
I assume that you have Yanfly's Buffs and States Core and Auto Passive States plugins, so I hope this might help:

- Setup this state as your passive state. The combo state only works in battle and resets for each battle. For each combo stack, the damage increases by 50 for example:

If this works and you need another way to increase the damage per stack, please let me know.


That works like a charm. Thank you so much! <3

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-lunatic-code-help.118875/