State that applies it's effect every 3 turns.

Hello!

I am trying to figure out how to script $gameTroop.turnCount() to check if it's the 3rd turn, reset and count to 3rd turn again.

I figured I should put it inside a notetag like this, but no idea how the math will work.

Code:
<Custom Turn End Effect>

if (math to check if it's the third turn)

    state effect does it's thing

</Custom Turn End Effect>

The state will be applied from the start, and ends when the battle ends.
You could use modulo:

if ($gameTroop.turnCount() % 3 === 0)
The state will be applied from the start, and ends when the battle ends.
You could also just use a troop event.
You could also just use a troop event.
I can't since the state would be applied from an equipment.

You could use modulo:

if ($gameTroop.turnCount() % 3 === 0)
Sorry I'm not familiar, but what does % 3 === 0 actually mean?
I can't since the state would be applied from an equipment.
Of course you can - the engine doesn't care where a state comes from.

You do a troop event with condition Turn 3 + 3, use regular event commands to check the actors for having the state and if yes do whatever you want.

You can also use the code Trihan provided, but if you're not comfortable with JavaScript this is perfectly doable in events.
Of course you can - the engine doesn't care where a state comes from.

You do a troop event with condition Turn 3 + 3, use regular event commands to check the actors for having the state and if yes do whatever you want.

You can also use the code Trihan provided, but if you're not comfortable with JavaScript this is perfectly doable in events.
Oh yeah that can work!
I just need to check if the actor has the equipment that has the state equipped right? Or just the state itself if it's in the actor?
Whatever pleases your soul...there are options in the Conditional Branch for both of those things. If the state doesn't have any other innate effect or you don't care whether it shows a state icon, you don't even need a passive state from the equipment at all.
Sorry I'm not familiar, but what does % 3 === 0 actually mean?
The % operator divides the left side by the right side and returns the remainder. So X % 3 is dividing X by 3 and giving you what's left. For any multiple of 3, that will be 0, which is why that's the value you're checking it against.
The % operator divides the left side by the right side and returns the remainder. So X % 3 is dividing X by 3 and giving you what's left. For any multiple of 3, that will be 0, which is why that's the value you're checking it against.
Thank you for the explanation!

Original thread: https://forums.rpgmakerweb.com/threads/state-that-applies-its-effect-every-3-turns.159043/