MV A bundle of problems

Eh, this may be ugly but try adding this as a plugin:

(function() { var variableId = 0; // change var id var stateId = 0; // change state id var animationId = 0; //change animation id var AG_EvasionState_Game_Actor_performEvasion = Game_Actor.prototype.performEvasion; Game_Actor.prototype.performEvasion = function() { AG_EvasionState_Game_Actor_performEvasion.call(this); if($gameVariables.value(variableId) === 1){ this.addState(stateId); this.startAnimation(animationId); } }; })();

I haven't tested this code ingame but you do for me x)
Make the State in database have 100% chance to be removed upon taking damage and you can use some other plugin that allows stackable states? I don't know, I'm too lazy to do with Buffs, sorry. Good luck lol.
I figured out how I am going to approach increasing attack power by using a variety states so the player loses states and gains a better one, however, how do I check if the evading actor is affected by a state? I tried using this.isStateAffected(1) != 1) to check if we don't have that state, if not then it'll apply it, but it doesn't even apply the state at all anymore.

Once that's figured out, I can just add else and more checks to see if other states are applied that way a state is removed and the better one is applied after every successful evade. I just also wish there was a way to hide the pop-up text when you gain a state so the player won't have to see "+Stylish Evasion Lv1/Lv2/Lv3/MAX" throughout the entire battle.

Code:
(function() {
   var variableId = 307;  // change var id
   var stateId = 63;      // change state id
   var stateLvl2= 64;      // change state id
   var stateLv3 = 65;      // change state id
   var stateLvMax = 66;      // change state id
   var animationId = 340;    //change animation id

   var AG_EvasionState_Game_Actor_performEvasion = Game_Actor.prototype.performEvasion;
   Game_Actor.prototype.performEvasion = function() {
       AG_EvasionState_Game_Actor_performEvasion.call(this);
       if($gameVariables.value(variableId) === 1 && this.isStateAffected(1) != 1){
              this.addState(stateId);
              this.startAnimation(animationId);
       }
   };
})();
this.isStateAffected(stateId) != 1
to
!this.isStateAffected(stateId)
So I'm using this right now, and it doesn't seem to work.

Code:
(function() {
   var variableId = 307;  // change var id
   var KOstate = 1;
   var stateId = 63;      // change state id
   var Lvl2= 64;      // change state id
   var Lv3 = 65;      // change state id
   var LvMax = 66;      // change state id
   var animationId = 340;    //change animation id

   var AG_EvasionState_Game_Actor_performEvasion = Game_Actor.prototype.performEvasion;
   Game_Actor.prototype.performEvasion = function() {
       AG_EvasionState_Game_Actor_performEvasion.call(this);
       if($gameVariables.value(variableId) === 1 && !this.isStateAffected(KOstate)) && !this.isStateAffected(stateId)){
              this.addState(stateId);
              this.startAnimation(animationId);
       }
   };
})();

Edit:
Once I remove my state condition checks, it works again...

Edit 2:
Removed extra ")", works now.

Edit 3:
The topic can be closed now, I'll start learning JavaScript lmao... Thanks for the help everyone.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/a-bundle-of-problems.133801/