MV Looking For a plugin That reduces action times chances (also nicknamed as extra actions) or having them be removed

Has anyone ever made a plugin that effects action times specifically,to give an example of what I'm looking for I was wondering if there was a way to make a state that reduces chances of an actor or an enemy to not use their extra actions (if they have it to begin with in the first place) or have it be completely removed
I think it works like this (copy paste to notepad, save as .js file and add as plugin). Change X to state id which removes the action times and state Y to state id which halves takes 50% off.

Game_BattlerBase.prototype.actionPlusSet = function() {
return this.traits(Game_BattlerBase.TRAIT_ACTION_PLUS).map(function(trait) {
if (this.isStateAffected(X)) return 0;
if (this.isStateAffected(Y)) return trait.value-0.5;
return trait.value;
});
};
I think it works like this (copy paste to notepad, save as .js file and add as plugin). Change X to state id which removes the action times and state Y to state id which halves takes 50% off.

Game_BattlerBase.prototype.actionPlusSet = function() {
return this.traits(Game_BattlerBase.TRAIT_ACTION_PLUS).map(function(trait) {
if (this.isStateAffected(X)) return 0;
if (this.isStateAffected(Y)) return trait.value-0.5;
return trait.value;
});
};
1776720213928.png

i have gotten this error
Yeah, that's because I don't know proper coding. You need to give it the this value, try adding it there like (remember to change X and Y):

Game_BattlerBase.prototype.actionPlusSet = function() {
return this.traits(Game_BattlerBase.TRAIT_ACTION_PLUS).map(function(trait) {
if (this.isStateAffected(X)) return 0;
if (this.isStateAffected(Y)) return trait.value-0.5;
return trait.value;
}, this);
};

EDIT: And as a note, I don't know if Yanfly has changed the system in some of their plugins.
EDIT2: Also, currently the "state Y" is reducing the change by 50%, not halving the chance. So it'll go from 100% to 50% and from 50% to 0.
Yeah, that's because I don't know proper coding. You need to give it the this value, try adding it there like (remember to change X and Y):

Game_BattlerBase.prototype.actionPlusSet = function() {
return this.traits(Game_BattlerBase.TRAIT_ACTION_PLUS).map(function(trait) {
if (this.isStateAffected(X)) return 0;
if (this.isStateAffected(Y)) return trait.value-0.5;
return trait.value;
}, this);
};

EDIT: And as a note, I don't know if Yanfly has changed the system in some of their plugins.
EDIT2: Also, currently the "state Y" is reducing the change by 50%, not halving the chance. So it'll go from 100% to 50% and from 50% to 0.
thanks it works,the only notibale thing i should mention is that upon inflicting the state that completely removes the extra action chance if the state is inflicted in the middle of the battle the target still does a double action, it's only when the turn ends and the next one he does't do
Cool. If you want to add that functionality, you can use Yanfly notetags to have it remove/clear all the actions but the first one when the state is added.

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-a-plugin-that-reduces-action-times-chances-also-nicknamed-as-extra-actions-or-having-them-be-removed.183326/