Is it possible to create a state to "bypass accuracy"

I'm trying to create an upgrade for one of my characters where when a magic skill is used there is a chance that it will bypass accuracy check/guaranteed hit the opponent. Is there anyway to do this? I have access to the Yanfly MV plugins if that helps
You could do it inside the Yanfly Hit Accuracy plugin parameters, but that's a little convoluted.

It's probably easiest to do this. Paste the below into a text editor, save as a *.js file, include as a plugin.
Code:
var origItemEva = Game_Action.prototype.itemEva
Game_Action.prototype.itemEva = function(target) {
    if (BattleManager._subject.isStateAffected(69) && this.isMagical())
        return 0;
    else
        return origItemEva.call(this, target);
};

Replace 69 with the ID of your state.
You could do it inside the Yanfly Hit Accuracy plugin parameters, but that's a little convoluted.

It's probably easiest to do this. Paste the below into a text editor, save as a *.js file, include as a plugin.
Code:
var origItemEva = Game_Action.prototype.itemEva
Game_Action.prototype.itemEva = function(target) {
    if (BattleManager._subject.isStateAffected(69) && this.isMagical())
        return 0;
    else
        return origItemEva.call(this, target);
};

Replace 69 with the ID of your state.
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-create-a-state-to-bypass-accuracy.166083/