I've looked into it. I'm sorry but I haven't gotten a clue. Why would you put target.isGuard() in a note, though?
Viewing post in I've changed from the comments to the community board
Doing some debugging and I think the issue might lie with YEP Battle Core, but I'm not sure what, I tried disabling every plugin except for it and I noticed guarding doesn't expire with it active. I don't know why that would cause a secondary issue when combined with your plugin, but I'm willing to bet that's the cause.
So I think the issue is that "PressTurnBattleSystem_removeStatesAuto.call(battler, 2);" is in the wrong location, it's being removed before the enemy move, when it should be called at the beginning of the player turn. I'm trying to find the best place to put it, but I have the skill working aside from the fact that the guard doesn't get removed after the turn starts.
Code to remove guard from allies at the beginning of allied turn (replaces same function)
BattleManager.MakeAllyTurns = function () { for (const battler of $gameTroop.members().concat($gameParty.members())) { battler.removeState(2); } pressTurnBattle.allyBattlersTurns = $gameParty.aliveMembers().length - stunnedAlies(); pressTurnBattle.allyBattlersTurnsCheck = pressTurnBattle.allyBattlersTurns; if (pressTurnParams.BasedOnAmountOfTeamsMembers === "true") { pressTurnBattle.allyBattlersTurnsMax = pressTurnBattle.allyBattlersTurns * Number(pressTurnParams.MaxTurnsPerBattler); } else pressTurnBattle.allyBattlersTurnsMax = Number(pressTurnParams.MaxTeamsTurns); }
and then to remove the guard status if they use another skill i added to the startaction function
var BattleManager_startAction_Mine = BattleManager.startAction; BattleManager.startAction = function () { BattleManager_startAction_Mine.call(this); if(this._action.item().skillId != $dataSkills[this._action.subject().guardSkillId()]){ this._action.subject().removeState(2); } if(!this._action.item().note.includes("<Don't lose turn>")) { pressTurnBattle.turnIndex++;} if (pressTurnBattle.alliesTurns){ if(!this._action.item().note.includes("<Don't skip turn>")) { pressTurnBattle.allyBattlersTurns--; pressTurnBattle.gainedTurn = false; } if (pressTurnBattle.turnIndex === $gameParty.aliveMembers().length){ pressTurnBattle.turnIndex = 0;} BattleManager.drawPressIcons(); } else { pressTurnBattle.enemyBattlersTurns--; if (pressTurnBattle.turnIndex === $gameTroop.aliveMembers().length) pressTurnBattle.turnIndex = 0; } }
Feel free to use it! (You'd also have to remove the existing use of this._action.subject().removeState(2))
I think it would benefit the plugin because I'm not sure if guarding works correctly the way it's written right now, I'd have to test it out because while it was showing the guard animation, it seemed like it wasn't calculating the effect.
I would also recommend having a note telling players to remove the "Auto-removal Timing" that RPG Maker MV has on by default for the Guard State if you do this, because I think those might conflict with each other.
Ultimately up to you if you use it, but I'd definitely recommend it!