How to create stacking buffs/debuffs similar to Pokemon?

I want to be able to make stacking buffs/defbuffs that go by Pokemon's rule. In Pokemon, you can increase or decrease a specific stat up to 6 times (stages). 


Something like:


+1 = 150% stat


+2 = 200% stat


+3 = 250% stat


or


-1 = 66% stat


-2 = 50% stat


-3 = 40% stat


I'm not sure how I could make this, so any help would be appreciated! Maybe there's a script out there that I don't know of.

2da12cfeec8ec1bed208ff344a291e22.png
My State Stages script was made for this very reason, unfortunately it isn't for MV.

Spoiler
State_Stages_00.PNG


State_Stages_01.PNG



However, I did take a brief look around and found a few plugins that may help.


Overriding States - Hime


State Add/Remove Commands - Shaz


RMMV State Triggers - DoubleX
Yanfly's buffs and states core allows you to change how many times a buff or debuff can stack
In the plugin settings there is are a few options for stacking buffs (Buff settings):


Default Limit: 6


Maximum Limit: 6


Buff Formula: Blah

Normally, MV allows buffs to stack twice. In pokemon, as you have stated, buffs can be stacked up 6 times.
Your main issue is formula. The buff formula in Yanfly's plugin (default formula) is: No. of stacks x factor + 1


This formula doesn't work well with Pokemon which uses:
(No. of stacks + 2) / 2 for buffs and
2 / (No. of stacks + 2) for debuffs


At the moment, the only way I can think of to incorporate this formula will be:

if (this._buffs[paramId] > 0) { (this._buffs[paramId] + 2) / 2 } else { (2 / (this._buffs[paramId] + 2) }


Note that the formulas are different depending if it's a debuff or a buff.
Also, evasion and accuracy cannot be modified in this way (you will have to use a state or something along those lines)

 

Original thread: https://forums.rpgmakerweb.com/threads/how-to-create-stacking-buffs-debuffs-similar-to-pokemon.67240/