Is there a plugin that can modify the State Rate Formula?

Does anyone know of a plugin that can change the formulas that work in-game, like Yanfly's Damage Core and Hit Accuracy?
If not, does anyone know which JS file in RPG MV can modify the probability of receiving status ailments?

Since I do not use Mat and Mdf in my game, I would like to refer to this stat and change the probability of receiving status ailments.
Example) If Effect RES(Mat) is 50, the probability of inflicting status ailments on enemy skills is reduced by 50%.
If not, does anyone know which JS file in RPG MV can modify the probability of receiving status ailments?
you can copy Game_Battler.prototype.addState from the objects file and make a new plugin that overwrites the function as a direct way of doing what you want, but i wouldnt suggest it.

If youre using yanfly's plugins, Id suggest 2 things. 1 - that you use skill notetags like after and post-damage eval to apply negative states instead of the effects pane, and then 2 - make a new function that does all the probability calculations you need done, and then within it call addState once all of it passes.
that way, you can have the choice of having some skills apply states using the default way or your new way that uses the target's parameters, you dont get positive states denied because your MAT is high, and it allows the default engine to still apply states normally (like not using MAT to decide whether or not a battler dies when they are killed, or troop events to add states failing because of MAT)
you can copy Game_Battler.prototype.addState from the objects file and make a new plugin that overwrites the function as a direct way of doing what you want, but i wouldnt suggest it.

If youre using yanfly's plugins, Id suggest 2 things. 1 - that you use skill notetags like after and post-damage eval to apply negative states instead of the effects pane, and then 2 - make a new function that does all the probability calculations you need done, and then within it call addState once all of it passes.
that way, you can have the choice of having some skills apply states using the default way or your new way that uses the target's parameters, you dont get positive states denied because your MAT is high, and it allows the default engine to still apply states normally (like not using MAT to decide whether or not a battler dies when they are killed, or troop events to add states failing because of MAT)


thank you! It took me a little while to understand, but it works perfectly.

JavaScript:
<Post-Damage Eval>
var SkillRate = 100;
var StateID = 6;


var StateRate = SkillRate - target.mat;
var Random = Math.floor(Math.random() * 100) + 1;
if (StateRate >= Random) {
target.addState(StateID);
} else {
target.customPopup($dataStates[StateID].name + " Resistance!", 2);
}
</Post-Damage Eval>

There is a slight problem with the Damage Popup printed with LGP - Better Damage Popup not moving... but I am satisfied as it works well.
thank you! It took me a little while to understand, but it works perfectly.
you got in the end, but i was a little unclear. there was one bit i left out that was meant to save you time and effort in the long run.

2 - make a new function that does all the probability calculations you need done, and then within it call addState once all of it passes. Then you would just need to call it inside the skill tags
so lets yoink what you have right there and add it as a plugin to create a new battler function:
Code:
Game_Battler.prototype.addAilment = function(state, rate){
    if (rate - this.mat >= Math.randomInt(100) + 1)
        this.addState(state);
    else
        this.customPopup($dataStates[state].name + " Resistance!", 2);
}
and now inside any skill that inflicts an "ailment", youd just need to use
Code:
<Post-Damage Eval>
target.addAilment(6, 100);
</Post-Damage Eval>
to do all of that.

the reason to make it a function is now that it saves you from having to type out all of that in each skill that makes use of an ailment, and should you find the need to ever change how the system should work, you dont need to hunt down every place you used it and change them all manually. youd just adjust it in the plugin and it would apply to everywhere you used it

There is a slight problem with the Damage Popup printed with LGP - Better Damage Popup not moving... but I am satisfied as it works well.
cant say i can help with that one. never heard of it ill now 😛
But if it works for you then it works. that being said, once/if you do find a way to get it moving, you can fix it within the function and it would work in all the skills you put it in
you got in the end, but i was a little unclear. there was one bit i left out that was meant to save you time and effort in the long run.


so lets yoink what you have right there and add it as a plugin to create a new battler function:
Code:
Game_Battler.prototype.addAilment = function(state, rate){
    if (rate - this.mat >= Math.randomInt(100) + 1)
        this.addState(state);
    else
        this.customPopup($dataStates[state].name + " Resistance!", 2);
}
and now inside any skill that inflicts an "ailment", youd just need to use
Code:
<Post-Damage Eval>
target.addAilment(6, 100);
</Post-Damage Eval>
to do all of that.

the reason to make it a function is now that it saves you from having to type out all of that in each skill that makes use of an ailment, and should you find the need to ever change how the system should work, you dont need to hunt down every place you used it and change them all manually. youd just adjust it in the plugin and it would apply to everywhere you used it


cant say i can help with that one. never heard of it ill now 😛
But if it works for you then it works. that being said, once/if you do find a way to get it moving, you can fix it within the function and it would work in all the skills you put it in

thank you! If you do this, you can use it easily!
I will find a solution for any issues related to LGP - Better Damage Popup! Thank you again!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-plugin-that-can-modify-the-state-rate-formula.170811/