MZ Stacking states with effects per stack?

Hello again,

I'd like to make states that for example increase damage dealt/received by x element by y% per stack or increase any sort of parameter by x% per stack. Looking at the Tips and Tricks entries for Toxic/Stockpile, I can probably figure out how to make multiple stacks of a state, but I'm stuck on the "increase things per stack" bit. Is there a way to do this using the JS notetags (I'm using most of VisuStella's plugins) for states instead of having to paste relevant code in every related skill's note box? And if yes, would anyone like to help me accomplish this? 😅

Thanks in advance!
Bump
You're asking two different things here.

Parameters can be edited directly, so you could do something like this, using VisuStella Skills and States and Core Engine:
Code:
<JS On Add State>
target.stateAtkBuff??=0;
target.stateAtkBuff++;
</JS On Add State>

<JS On Erase State>
delete target.stateAtkBuff;
</JS On Erase State>

<JS ATK Plus: user.stateAtkBuff>
If the ATK buff doesn't work, you might try replacing user with this...the plugin documentation isn't clear.

If you have multiple states that work like this, the variable name needs to be unique for each one, so you'd change stateAtkBuff to anything else you want.

Element rates, however, are traits, not parameters. So the above stuff doesn't work with that. You would either need to use a dynamic trait plugin that functions with MZ, or you'd need to make separate states for every different different rate and use the On Add State to see which one the battler currently has and replace it with the next level.
You're asking two different things here.

Parameters can be edited directly, so you could do something like this, using VisuStella Skills and States and Core Engine:
Code:
<JS On Add State>
target.stateAtkBuff??=0;
target.stateAtkBuff++;
</JS On Add State>

<JS On Erase State>
delete target.stateAtkBuff;
</JS On Erase State>

<JS ATK Plus: user.stateAtkBuff>
If the ATK buff doesn't work, you might try replacing user with this...the plugin documentation isn't clear.

If you have multiple states that work like this, the variable name needs to be unique for each one, so you'd change stateAtkBuff to anything else you want.

Element rates, however, are traits, not parameters. So the above stuff doesn't work with that. You would either need to use a dynamic trait plugin that functions with MZ, or you'd need to make separate states for every different different rate and use the On Add State to see which one the battler currently has and replace it with the next level.
1689088726606.png

Could these note tags possibly work like the JS ATK Plus one you suggested does, then?
Maybe? What plugin are they from?
Maybe? What plugin are they from?
They're from Visustella's Element Status Core.
Looks like yes.
It seems I got the stacking to work with the above note tags, but I can't seem to get the math to work right. Assuming the element ruling is set to Multiply, how would I modify it so that each stack makes the affected character deal 8% more damage with x element?

My current setup is this, and each stack multiplies the original damage by 2x, 3x and so on:
1689092626870.png

I tried multiplying this.lightDmg by either 1.08 or 0.08, but the results didn't seem anywhere close to 8% either 😅 Math isn't exactly my strongest suit.
Well I don't see anyplace that you're doing any number like that.

++ means you add one, so lightDmg++ will go from 0 to 1, 2, etc.

If you want to make it something else, then you need to make that something else 😉
e.g. this.lightDmg+=.08

Original thread: https://forums.rpgmakerweb.com/threads/stacking-states-with-effects-per-stack.159074/