@kuroshinne Well I think I can help you out, you will need other Yanfly scripts tough, you'll need the Acton Sequence packs the three of them.
However this code will NOT work correctly if you have more than one spellslinger in the party
Then well in your spell slinger state you should add this code.
Code:
<Custom Battle Effect>
user._spellsStacks = $gameVariables.value(X) || 0;
var stacks = user._spellsStacks.clamp(0, 5)
user.setStateCounter(Y, stacks);
user.refresh();
</Custom Battle Effect>
<Custom Action End Effect>
user._spellsStacks = $gameVariables.value(X) || 0;
var stacks = user._spellsStacks.clamp(0, 5)
user.setStateCounter(Y, stacks);
user.refresh();
</Custom Action End Effect>
Where X is the variable you want to work with and Y is the state ID. After that, you need to add this piece of code in each of the spells you want the spellslinger to have.
Code:
<setup action>
change variable X += 1
perform start
</setup action>
Where X is the same as above.
Then you need to add this to the Attack damage formula.
Code:
if (a.isStateAffected(Y) && $gameVariables.value(X) > 0) {(Damage Formula) * (1 + (v[X] * 0.20)); a.gainMp(Math.floor((a.mmp * 0.10) * v[X]));} else {Damage Formula;}
Where again X and Y are the same as above X is the variable and Y is the state.
Then you need to add this into the Attack note tags.
Code:
<finish action>
if (user.isStateAffected(17) && $gameVariables.value(19) > 0)
change variable 19 = 0
else
end
perform finish
</finish action>
This should make everything work I belive.