De/buff formula management

Heya
I've been browsing for an answer, but the scripts I found about my issue weren't working or not accurate
So, the debuff and buff formula in VX ACE is kind of mathematically wrong

For instance, if you have 200 ATK :
reduced 2 times (-50%), it becomes 100 ATK (half of its original value)
increased 2 times (+50%), it becomes 300 ATK (1.5 times its original value. It should be double, not 1.5 times!!)

It's multiplicative inverse. Further proof : if you could reduce it 4 times (-100%), your stat would become null, which is kind of gamebreaking ^^

I'm using Yanfly's Buff & Status Manager, here's the formula described (the one used in VX Ace)
Code:
    # This is the formula used to apply the rate used for buffs and debuffs.
    BUFF_BOOST_FORMULA = "buff_level(param_id) * 0.25 + 1.0"
This formula's result varies between 0.5 and 1.5 (depending on the buff level - that is [-2, 2]). The result should actually varies between 0.666667 and 1.5 (as 0.66667 is the multiplicative inverse of 1.5)
In practice, how could I ask the formula to be like :
Code:
    BUFF_BOOST_FORMULA = "0.8 ** buff_level(param_id)"
if buff_level(param_id) is < 0
and
Code:
    BUFF_BOOST_FORMULA = "buff_level(param_id) * 0.25 + 1.0"
if buff_level(param_id) is >= 0 ??

Thanks in advance and sorry if this was already asked
You kinda answered your own question. 😀
Guess the correct syntax is what you are after, right?
Code:
BUFF_BOOST_FORMULA = "
if buff_level(param_id) < 0;
  0.8 ** buff_level(param_id);
else;
 buff_level(param_id) * 0.25 + 1.0;
end
"
Or, if you don't mind it being a lengthy one-liner:
Code:
BUFF_BOOST_FORMULA = "buff_level(param_id) < 0 ? 0.8 ** buff_level(param_id) : buff_level(param_id) * 0.25 + 1.0"

Just to warn you, the first formula you entered will actually increase the parameter, and it will increase it more and more the lower the buff level gets.
If you invert the buff_level variable, than it will lower the parameter. I suppose it should lower it when the buff level is < 0 (debuffed), right?
You can simply put a .abs at the end of it, and it will work fine.

But the description in the engine itself clearly states that it is +/-25% per buff level.
The max is +/-2 levels (by default), so it's -50% to +50%, and the default formula does exactly that, no mistakes there. Even your direct example proves this.
It is not an inverse multiplier bonus, not the way you think it is.
It's just a simple formula made for the simple default engine which is capped in many ways, so they never considered to account for more than +/-2 buff levels.
Yupp, thaaaaanks!! Thats exactly what I was looking for, it's just I'm bad with scripts xD

My first expression was wrong yeah, I forgot negative power gives inverse multiplier. I went with buff_level(param_id).abs and it worked
Still, even if the database description is true, it still feels weird to have debuff being more powerful mathematically than buffs
Actually there's the same thing for the default damage formula : a.atk * 4 - b.def * 2 means atk is worth 2 times more than defense :\
Understandable for a casual game, but definitely not for advanced ones T^T

thanks a lot for the halp

Original thread: https://forums.rpgmakerweb.com/threads/de-buff-formula-management.80441/