Creating a state that guarantees getting hit by critical hits

I have a State called "Staggered" where if you get attacked while you still have the effect, you will always receive a critical hit. The problem is, I can't seem to figure out how to make it work. Any suggestions?
Can't you just put something like "Critical Evasion -999%" in the state traits?
Critical Evasion just makes it so that you dodge a critical when it is rolled. It will not make it so that you always get a critical hit though. If you want it to be so that you always get a critical hit when hit under that state, you'll need a plug-in.

Moving to Plug-in Requests

Simple Enough,

JavaScript:
Game_Action.prototype.apply = function(target) {
  var result = target.result();
  this.subject().clearResult();
  result.clear();
  result.used = this.testApply(target);
  result.missed = (result.used && Math.random() >= this.itemHit(target));
  result.evaded = (!result.missed && Math.random() < this.itemEva(target));
  result.physical = this.isPhysical();
  result.drain = this.isDrain();
  if (result.isHit()) {
      if (this.item().damage.type > 0) {
          result.critical = (Math.random() < this.itemCri(target));
          result.critical = (target.isStateAffected(ADD_ID_OF_STATE_HERE) ? true : result.critical);
          var value = this.makeDamageValue(target, result.critical);
          this.executeDamage(target, value);
      }
      this.item().effects.forEach(function(effect) {
          this.applyItemEffect(target, effect);
      }, this);
      this.applyItemUserEffect(target);
  }
};

Either add this in a plugin or modify the Game_Action.prototype.apply function directly, i recommend the former... make sure to replace ADD_ID_OF_STATE_HERE with the id of the actual state obviously.
Thanks! It works well.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-state-that-guarantees-getting-hit-by-critical-hits.121932/