MV modding YEP's Base Param Control for ailment boost?

I'm trying to do an equivalent of persona's ailment boost abilities and I thought I could use the lukeffectrate part of this plugin like this:

Game_Action.prototype.lukEffectRate = function(target,stateId) { var item = this.item(); var skill = this.item(); var a = this.subject(); var user = this.subject(); var subject = this.subject(); var b = target; var s = $gameSwitches._data; var v = $gameVariables._data; var ailmentrate = eval(Yanfly.Param.BPCLukEffectRate); // I added this if (user.isStateaffected(25)) { ailmentrate *= 2 } return ailmentrate; };

but I get "user.isstateaffected(25) isn't a function", how do I check if the user is affected by a state?
maybe user.isstateaffected() doesn't work in game_action? I'm not an expert :/
JavaScript is case-sensitive: it should be isStateAffected.

That said, you should do this via the plugin parameters, not by editing the code!
  • Open the Plugin Manager,
  • Double-click YEP_BaseParamControl to view its details,
  • Double-click the LUK Effect parameter on the right to edit it.
The default formula is this:
JavaScript:
Math.max(1.0 + (user.luk - target.luk) * 0.001, 0.0)
For your purposes, you can change it to this:
JavaScript:
Math.max(1.0 + (user.luk - target.luk) * 0.001, 0.0) * (user.isStateAffected(25) ? 2 : 1)
I.e. multiply by 2 if they're affected by state 25, otherwise 1 (no change).

Remember to save your project to apply Plugin Manager changes before testing. I also recommend you re-download the plugin to be certain that there are no remaining edits.
yeah fixing the lowercase worked, I am now ashamed.
I had to go into the code to make more complicated things though, the one I posted was using just 1 state and I actually used like 40.
I guess this is karma for always ctrl-Ving functions.

Original thread: https://forums.rpgmakerweb.com/threads/modding-yeps-base-param-control-for-ailment-boost.138403/