MZ Param-based or state-based buff/debuffs for project?

So I'm at an impasse with my project where I do not know if I want to go with the default param-based buffs/debuffs (i.e. skill effects > param > add buff), or if I want to go with state-based buffs/debuffs. I initially went with state-based de/buffs, because I've seen a lot of people advise for that as states allow for much greater control. And while it certainly has in many ways, in other ways it's actually more limiting than I like it to be.

The problem with state-based de/buffs is that their effect isn't increased when applied multiple times. With the default method, when a skill with the "add buff" effect is first used, the applied buff is +25%. Then if it used a second time, the buff goes up to +50% (which caps there).

However, to my knowledge and what I was told, this doesn't happen with state-based de/buffs. If the state is applied again, it only resets the remaining turns and does not increase the de/buff's effect. For some projects this is a non-issue, but it's troublesome for me because I would ideally like state de/buffs that also increases the effect. Unfortunately VisuStella's Skills & States Core doesn't have a support for this, only for extending turns.

I could just switch over to the default param-based de/buffs. But aside from having to redo a lot of my current work, this is also kind of complicated by some skills I have. Namely...

  • Divide: Divides all of an enemy's stats by half. This is done with a state and it also removes any conflicting buff/debuff states that might complicate the skill.
  • Attk Up / Def Down: A reversal skill; increases attack while decreasing defense. Again this also removes any conflicting buff/debuff states.
  • Def Up / Attk Down: Reverse of above. This would also remove the AU/DD state, and vice versa.

These skills could also be achieved with the default param-based buffs/debuffs, I'm sure. But as they themselves are state-based, it just seems easier to relegate all buffs/debuffs as states in-general.

So I guess I need some advice on what to do here. I am in general more in favor of state-based, but the lack of applied effects increasing has me unsure and I don't know if MZ has a plugin to support that. Do I keep the state de/buffs and accept there cannot be increased effects, or do I switch over to param-based de/buffs and accept their own cons? Thanks.
there is plugins that allow stacking states. if visu doesnt cover that then fossil yanfly plugins will.

it looks like this should be possible with visu skill/state plugin since 'on add/remove' is the same thing as 'custom apply/remove'
I think Stockpile is one of the remaining effects for my VisuStella conversion topic. I'll be finishing that tomorrow.
Yeah that's what I gonna say -- by introducing variables / counters to your states via Visustella <JS> notetags, you can use these variables to calculate parameter modifications, display these in the state display (afaik) like a normal stack count, and even make different skills interact differently with said counters. Probably the best of both worlds? But maybe kind of complicated. Give it a shot, especially with how wonderful Trihan's work's been doing with converting Yanfly Tips and Tricks to MZ.
Mmm... While certainly a good idea, I feel that another skill of mine might complicate that solution.

  • Permanence: Increases a target's buff turns by +10 (tentative).
By default, the state de/buffs last about 3 turns each. If effect stack is stored in a state's remaining turns, would that not also complicate that? Unless I'm completely misunderstanding here.
If effect stack is stored in a state's remaining turns
nopenope it's not that! What you do is, and @Trihan please correct me if I'm wrong, you create a new variable that exists inside that particular instance of that state. This variable is completely unrelated to turn count, or to anything else for that matter, and it'll only do something if you tell it to.
You then decide how you want to manipulate that variable. (For example, I want skills that apply this state to increase the ATKStack variable by 2, or something of the sort. I want this state to always initialize ATKStack to 5. I want ATKStack to be reduced by 1 every time that battler takes damage. Etc)

Once you got that working, meaning you have a state with a meaningless variable that can be increased or decreased through different means (that you can configure inside of the state itself, or inside the skill that you want to modify the state stacks), you can then attribute some meaning.

For example, you can then go and decide that ATK = ATK * 1.0 + (ATKStacks * 0.1).
This will be completely separate from turn count. You can use variables like this for all sorts of different effects, though I admit I don't fully grasp it nor have I played much with it.

If you want to dislpay this variable in addition to remaining turns, there may be a notetag for that. I can't tell that much, but I'm 100% sure there's a way -- it's either via a notetag or in the Plugin manager.
You're not far off Joseph, though the property is usually on the user/target rather than the state itself. And you're thinking of setStateDisplay.
I took a slightly different approach to stacking states in my project. I used different states to represent the different levels of stacks, then had the skill check which state was currently on the target before applying the state or overriding it with the higher stack version. The stack count is an image on the icon, which also means I can have the icon change colour as the stack count increases.

My project is in MV though, not sure how relevant this will be to MZ?

Code:
<Post-Damage Eval>
if(!target.isStateAffected(118) && !target.isStateAffected(119))
{
  target.addState(118);
}
else if (target.isStateAffected(118))
{
  target.removeState(118);
  target.addState(119);
}
else if (target.isStateAffected(119))
{
  target.removeState(119);
  target.addState(47);
}
</Post-Damage Eval>
This is one of my states that allows for stacking effect. Every application will further decrease DEF, and when the state falls off or is removed, it remembers how much DEF was deducted and adds that value back to the unit.
JavaScript:
<Custom Apply Effect>
var sunder = Math.round(origin.atk / 3);
target._sunder = target._sunder || 0;
target._sunder += sunder;
target.minusDef(sunder);
</Custom Apply Effect>
<Custom Remove Effect>
target.addDef(target._sunder);
delete target._sunder;
</Custom Remove Effect>

Using this method (with slight modifications), you can achieve the same effect as "Buffs/Debuffs".
Some of these are very good suggestions, thank you. In hindsight, javascript should've been the obvious answer. I'll try some of them out when I can. Although I think the solution of making a separate state for each stack would be way too much, imo.

I'd need some way of checking if the de/buffs are in fact stacking. I could probably use the Libra skill for that though, I think?
I'd need some way of checking if the de/buffs are in fact stacking. I could probably use the Libra skill for that though, I think?
You can use State Counters to keep track of that, as well as show a small number on the icon to let players know. If you can tell me exactly what your needs are, I can create a State to your specifications.
The only things I would like is a percentage counter for the stack and the standard turn counter. But if it's a choice between the two, then preferably the stack counter.
So, an update. After considering the options presented here and several days of fighting with javascript, I was able to get something that works with @Junane 's and @Trihan 's help on Discord using the multiple states-per-stack method (in my case, only two stacks):

Stack 1:
Code:
<Category: Attack>
<JS On Add State>
if (target._attk == undefined){
target._attk = target._attk || 0
target._attk +=1
} else if (target._attk === 1) {
target._attk +=1;
target.removeState(stack1);
target.addState(stack2);
} else if (target._attk === 2) {
target.addState(stack2);
}
</JS On Add State>
<JS On Erase State>
target._attk = undefined;
</JS On Erase State>

Stack 2:
Code:
<Remove Other Attack States>
<JS On Erase State>
target._attk = undefined;
</JS On Erase State>

Now I'm going to be honest: while I'm certainly very relieved to finally get stackable states to work and have learned a lot from this experience, it has also changed my views about states being the preferred for buffs and debuffs. It may give more control to the dev on a surface level, but after literally fighting with this I've begun to think otherwise. I don't think enough people think about stacking when recommending states. I certainly did not consider that until recently. There may be yet more potential cons with states I haven't even considered yet.

Regardless I have a method now that works, even though I am admittedly not too happy with having to make multiple states per stack per buff/debuff per parameter. Here is hoping that maybe in the future there will be better supports for this kind of thing. Thanks again everyone!
So, an update. After considering the options presented here and several days of fighting with javascript, I was able to get something that works with @Junane 's and @Trihan 's help on Discord using the multiple states-per-stack method (in my case, only two stacks):

Stack 1:
Code:
<Category: Attack>
<JS On Add State>
if (target._attk == undefined){
target._attk = target._attk || 0
target._attk +=1
} else if (target._attk === 1) {
target._attk +=1;
target.removeState(stack1);
target.addState(stack2);
} else if (target._attk === 2) {
target.addState(stack2);
}
</JS On Add State>
<JS On Erase State>
target._attk = undefined;
</JS On Erase State>

Stack 2:
Code:
<Remove Other Attack States>
<JS On Erase State>
target._attk = undefined;
</JS On Erase State>

Now I'm going to be honest: while I'm certainly very relieved to finally get stackable states to work and have learned a lot from this experience, it has also changed my views about states being the preferred for buffs and debuffs. It may give more control to the dev on a surface level, but after literally fighting with this I've begun to think otherwise. I don't think enough people think about stacking when recommending states. I certainly did not consider that until recently. There may be yet more potential cons with states I haven't even considered yet.

Regardless I have a method now that works, even though I am admittedly not too happy with having to make multiple states per stack per buff/debuff per parameter. Here is hoping that maybe in the future there will be better supports for this kind of thing. Thanks again everyone!
How badly do you want a version that works with a single state per buff/debuff?
Well I can certainly live with having to make multiple states per stack, especially with only two stacks max. It is doable, just takes a lot of time to setup and might not be the most efficient, cleanest way of going about this.

Having it all be one state per buff/debuff would be the ideal. I would certainly like it and prefer it, but I'm not begging either.

Original thread: https://forums.rpgmakerweb.com/threads/param-based-or-state-based-buff-debuffs-for-project.145503/