MV Chrono/Cross Engine ABS: Turning Switch on/off when guarding

Hi! Currently using the Cross Engine on MV (Restart's pixel-movement version of MOG's Chrono Engine) and I'm trying to turn a game switch on while guarding, then turn the switch off when guarding ends.

I'm not great at JS, but I managed to turn the switch on while guarding with the following:

Code:
//==============================
// * command Ras Guard
//==============================
Game_Player.prototype.commandRasGuard = function() {
    this.battler()._ras.guard.active = true;
    this.updateGuardDirection();
$gameSwitches.setValue(16, true);
};

However, I can't find a spot where I can add in a "$gameSwitches.setValue(16, false);" to flip the switch off when the player stops guarding. Any help would be appreciated!

Original thread: https://forums.rpgmakerweb.com/threads/chrono-cross-engine-abs-turning-switch-on-off-when-guarding.161727/