MV Custom Buff Formula in YEP Buffs & States Core

Hello everyone,

I'm working on a custom buff and debuff system using the YEP Buffs & States Core plugin in RPG Maker MV. I want to implement a new scaling formula for buffs and debuffs (similar to pokemon, but in this case, stacking to 4 instead of 6) that follows this multiplier scale:

+4 3.00x (300/100)+3 2.50x (250/100)+2 2.00x (200/100)+1 1.50x (150/100)0 1.00x (100/100)-1 0.66x (66/100)-2 0.50x (50/100)-3 0.40x (40/100)-4 0.33x (33/100)

The default formula in the plugin parameters is:

this._buffs[paramId] * 0.25 + 1.0

However, this does not fully achieve the scaling I need. I found an alternative formula in this thread:


But I don't know how to apply it.
JavaScript:
if (this._buffs[paramId] > 0) {return (this._buffs[paramId] + 2) / 2;} else {return 2 / (2 - this._buffs[paramId]);}

I would like to know:

  1. Can I simply replace the formula in the plugin parameters with this new one?
  2. Is there a Lunatic Mode notetag or another method in YEP Buffs & States Core that allows me to apply this formula correctly?
  3. If not, what else could I do?
I appreciate any help on this issue. Thanks in advance!
not sure if you can call a return in there but you can try making it a ternary operation instead
Code:
this._buffs[paramId] > 0 ? (this._buffs[paramId] + 2) / 2: 2 / (2 - this._buffs[paramId])
plug that in as the parameter
So I should replace the plugin formula for this one?
Well, I tried this and didn't work. I must be doing something wrong.
Let me show some prints of what I'm doing.

1740418605167.png


The state:

1740418698606.png


The skill that inflicts the buff:

1740418772749.png
are you actually buffing your battler? that plugin lets you change the max number of times buffs stack and that notetag is a means of manipulating that, bit it just affects the cap. the character still needs to be buffed.
e.g.
Code:
<After Eval>
user.addState(19)
user.addBuff(2,5)
user.addBuff(2,5)
user.addBuff(2,5)
user.addBuff(2,5)
</After Eval>
would increase their buff limit by 4 (assuming it doesnt go over the limit defined by you in the plugin parameters) and then also buff them 4 times as opposed to what youve shown, which would just increase the limit by 4
Right, I saw what I did wrong. But I tested this notetag that you showed and it kinda works. But de buff appears complete, in this case, with 300% rate (already with 4 stacks). What I wanted was that whenever I used the skill that gave the buff, it would gain a stack, until reaches the maximum (4 times). Sorry if I didn't explain this.

But anyway, So creating a state (in this case ID19) was not necessary, since the plugin already applies the buff according to this notetag you showed, right?
But I tested this notetag that you showed and it kinda works. But de buff appears complete, in this case, with 300% rate (already with 4 stacks)
what i have was just an example of the stacking and the cap. it wasnt meant to be an example of your initial goal. once you use the plugin parameters to determine how many stacks is the cap, just use the addBuff() function within the notetag one time or give the skill one add buff effect.


But anyway, So creating a state (in this case ID19) was not necessary, since the plugin already applies the buff according to this notetag you showed, right?
if you set up your plugin so that the initial cap and maximum cap are both 4, then theres no point for having the state. all the state does is increase the cap. you just need to buff the battler
Oh I see, I understand now. I tested it here and it worked exactly as I expected. Thank you very much for your help!

But I just have one more question, because I noticed that when I used the buff again, in addition to increasing the buff rate as expected, it also reset the turns, always returning to 5. That wouldn't be very good in my case, is there something like the notetag <Reapply Ignore Turns> but that works on skills?
is there something like the notetag <Reapply Ignore Turns> but that works on skills?
doesnt seem so. do you want to have all buffs to behave like that, or just the buffs granted by specific skills?

if buffs in general shouldnt be able to have their durations extended then that can be done with a small plugin. if only specific skills do that, then you need to use skill notetags like <After Eval> to log the target's buff duration and give them a buff with the same duration value.
doesnt seem so. do you want to have all buffs to behave like that, or just the buffs granted by specific skills?

if buffs in general shouldnt be able to have their durations extended then that can be done with a small plugin. if only specific skills do that, then you need to use skill notetags like <After Eval> to log the target's buff duration and give them a buff with the same duration value.
I think that the best option would be for some skills to do that. But I don't know how to make this possible.
I think that the best option would be for some skills to do that
any skill that shouldnt allow for extension will need to add buffs via notetags.
Code:
<After Eval>
var turns = target._buffTurns[2]
user.addBuff(2, turns || 5)
</After Eval>
so in this case, itll look at the time remaining for the target's atk buff and when it tries to apply the atk buff, its duration will be the same as it already was. if they didnt have one, then itll be 5.
That works fine! Thank you!

For debuffs it would be like this?
JavaScript:
<After Eval>
var turns = target._debuffTurns[2]
user.adddeBuff(2, turns || 5)
</After Eval>
That works fine! Thank you!

For debuffs it would be like this?
JavaScript:
<After Eval>
var turns = target._debuffTurns[2]
user.adddeBuff(2, turns || 5)
</After Eval>
not quite. _buffTurns holds the durations for both buffs and debuffs. the engine actually treats them both the same most of the time with debuffs just being negative. also addDebuff had a capitalized "D", not "B"

Code:
<After Eval>
var turns = target._buffTurns[2]
target.addDebuff(2, turns || 5)
</After Eval>

Original thread: https://forums.rpgmakerweb.com/threads/custom-buff-formula-in-yep-buffs-states-core.175714/