MZ Skip Turn in Battle if "X" condition for Actor

I'm having trouble figuring out what function to hook into to have actors skip turns if they don't meet a certain criteria

I added a property called pageCount to the actors. The idea is if their turn comes and their pageCount is less than 0, they skip their turns (reset Tpbcharge)


I'm using tbp wait and have been combing the BattleManager functions up and down and just have no idea which one to tap

halp lol!
usually skip turnsa are done by states with the restriction cannot move.
you might want to check how the default state "stun" handles this.
usually skip turnsa are done by states with the restriction cannot move.
you might want to check how the default state "stun" handles this.
I'll take a peek. I was originally trying to have the negative turn counts showing in the status area:

image.png


And got that much working at least (hurray!). But then whatever number initially gets drawn there gets stuck and wont update even if pageCount goes back to 0.

For context this is how i'm handling JSDawGauge_MP in skill States core:

Spoiler: MP Cost Type: JS Draw Gauge
// Declare Settings const color1 = ColorManager.mpGaugeColor1(); const color2 = ColorManager.mpGaugeColor2(); // Declare Variables const sprite = this; const settings = sprite._costSettings; const bitmap = sprite.bitmap; const user = sprite._battler; const currentValue = sprite.currentDisplayedValue(); const bitmapWidth = sprite.bitmapWidth(); const bitmapHeight = sprite.textHeight ? sprite.textHeight() : sprite.bitmapHeight(); const gaugeHeight = sprite.gaugeHeight(); // Pull Grimoire Equipped // const grimSlotId = 0; const grimoire = user.equips()[grimSlotId]; const grimIcon = grimoire && grimoire.iconIndex > 0 ? grimoire.iconIndex : 0; let icon = 3024; // Draw Gauge const gx = 0; const gy = bitmapHeight - gaugeHeight - 12; const gw = bitmapWidth; const gh = gaugeHeight + 12; /* if ($gameParty.inBattle() === false && $gameMap.isEventRunning() === false && SceneManager._scene instanceof Scene_Menu){ }else if (user.mmp >= 2){ if (user.mmp === 2){ this.drawFullGauge(color1, color2, gx, gy, gw/2, gh); } else { this.drawFullGauge(color1, color2, gx, gy, gw, gh); } } */ // Draw Icon const iconBitmap = ImageManager.loadSystem("IconSet"); const iw = ImageManager.iconWidth; const ih = ImageManager.iconHeight; if (grimIcon > 0){ let icon = grimIcon; const ix = (icon % 16) * iw; const iy = Math.floor(icon / 16) * ih; bitmap.blt(iconBitmap, ix, iy, iw, ih, 0, 0, 24, 24); } else { const ix = (icon % 16) * iw; const iy = Math.floor(icon / 16) * ih; bitmap.blt(iconBitmap, ix, iy, iw, ih, 0, 0, 24, 24); } // Draw Value const vw = 24; const vh = bitmapHeight; sprite.setupValueFont(); let mmpX = 0; console.log(user.pageCount); if ($gameParty.inBattle() === false && $gameMap.isEventRunning() === false && SceneManager._scene instanceof Scene_Menu){ } else if (user.pageCount < 0){ console.log(user.pageCount); bitmap.textColor = ColorManager.mpColor(user); bitmap.drawText(user.pageCount, 30, 0, vw, vh, "right"); }

Alright I set it up as a State hurray, using a passive that activates and manually sets the duration of the pseudo-"stun" state

1702652064700.png


But oddly enough, even though this Passive is set up as Actor only:

1702652114621.png


Enemies are still falling to its rule:

1702652129010.png



Sorted, had a stray note tag on the Attack skill that was adding the state to enemies. Cleaned that up, all good now!


Thankn you @Andar for the call on using a state instead. helped immensely
This thread is being closed due to being solved. I also merged your double post.

Original thread: https://forums.rpgmakerweb.com/threads/skip-turn-in-battle-if-x-condition-for-actor.163865/