MZ Flat Rate Increase with Buffs/Debuffs with Visustella SkillStates Core

Hi all,

My game uses some pretty low numbers (the default attack stat for the majority of actors is 1 or 2, for context!) - I want to make use of skills to buff and debuff stats, but with the numbers being so low, the engine's default method of handling buffs and debuffs means a skill that buffs will either be ludicrously weak (having no effect) or being blatently overpowered.

I am using Visustella and am trying to tinker with SkillStates Core. In the Buff/Debuff settings area you can set the Buff/Debuff rate.
The code reads as follows:

// Declare Variables
const user = this;
const paramId = arguments[0];
const buffLevel = arguments[1];
let rate = 1;
// Perform Calculations
rate += buffLevel;
// Return Rate
return Math.max(0, rate);

As far as I understand this, what I've actually done is made it so that a buff effectively doubles the stat, which is definitely not what I want.
What needs to change so that a buff would give a flat +1 increase to a stat, and a debuff would give a flat -1 to a stat?
The problems are these:
- The function that code is going into doesn't modify what you want. I assume that's replacement code for paramBuffRate(), which does not determine whether buffs are applied multiplicatively.

- The function you do want - Game_BattlerBase.param() - I strongly assume is overwritten by VisuStella Core Engine, in order for its parameter-modifying notetags to function.

And since their code is obfuscated, you can't simply modify the code in the plugin the way you want while letting the notetags still function.

You can try this. Paste the below code into a text editor, save as a *.js file, include it as a plugin above VisuStella Core. With any luck, their function will be aliased in a way that allows this change to make it through.
Code:
Game_BattlerBase.prototype.param = function(paramId) {
    const value =
        this.paramBasePlus(paramId) *
        this.paramRate(paramId) +
        this.paramBuffRate(paramId);
    const maxValue = this.paramMax(paramId);
    const minValue = this.paramMin(paramId);
    return Math.round(value.clamp(minValue, maxValue));
};

That, combined with how you modified the plugin parameter in your post, should cause buffs and debuffs to modify by 1 point per level.

If that doesn't work, I think you'll have to try a workaround using states that use the Param notetags instead of actual buffs and debuffs.
Blast, I was afraid of that. I tried your solution but unfortunately it still ends up doubling the stat instead of a +1.

I'll try and work out how I can create states so I can replicate buffs and debuffs for a +1/-1 stat modification then.
Thank you for trying anyway!

EDIT: Okay, I've got it.

<JS On Add State>
target.addParam(2, 1);
</JS On Add State>
<JS On Erase State>
target.addParam(2, -1);
</JS On Erase State>

This has the effect of raising the Attack stat (which is identified by '2') by 1 when applied, and when it wears off, the attack stat drops by 1 (back to normal).

I'll leave this here in case anyone else wants to do the same!
This thread is being closed due to being solved. If you need it reopened, report it to us to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/flat-rate-increase-with-buffs-debuffs-with-visustella-skillstates-core.159910/