Passives with cooldowns...

I'm sure there is a way to do it.
This is using YEP, Yanfly Passive State Core + Passive BUFF core.
I'm sure it has something to do using the custom respond effect...
BUT something very unclear- How would I go about having a passive that has a cooldown.

Example: for 3 turns x passive is active. Cool-down of x turns.

I'm sure it kind of goes like such- I'm sure it's like "if you are in a fight" state becomes true.
However, I'm not sure where to go from this because I don't have a clue how to "re activate that" passive that
says like how I made an example before.

If I needed an example of what I'm trying to do it would be kind of like: Every time user attacks while this passive is up
[this happens]. Then once it's used the passive doesn't disappear but it's inactive for the time being.

Code:
<Custom Passive Condition>
if ($gameParty.inBattle()) {
condition = true;
code
} else {
condition = false;
}
</Custom Passive Condition>
😀You can create a passive state "cooldown" using variables. Let's use variable 36, for example. If I'm reading this right, you want a passive on a character that is active until 'used'. Since I don't know exactly how you intend to 'use' this passive, I'll say it is used after an attack and has a cooldown of 3 turns.
Spoiler
<Custom Passive Condition>
if($gameVariables.value(36) <= 0) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
The passive condition will check the cooldown variable. If it's 0, or for some reason less than 0, the passive is not on cooldown and will be active - condition is true.
<Custom Turn End Effect>
$gameVariables.setValue(36, $gameVariables.value(36) -1);
</Custom Turn End Effect>
This will decrease the cooldown variable by 1 turn, at the end of every turn.

<Custom Escape Effect>
$gameVariables.setValue(36,0);
</Custom Escape Effect>

<Custom Victory Effect>
$gameVariables.setValue(36,0);
</Custom Victory Effect>
The above two are what I use as a personal failsafe to reset the cooldown variable when a battle ends by winning or fleeing.

<Custom Battle Effect>
$gameVariables.setValue(36,0);
</Custom Battle Effect>
Same thing, my personal failsafe to ensure the cooldown variable is 0 at a battle start, otherwise the passive may not be active when it should be.

Now, you just have to increase the variable to 3 whenever it is used. If this is being used after an attack, in all the skills you will want a conditional statement similar to what's below, to start the cooldown. You can run a Post-Damage Eval with Yanfly's Skill Core that will fulfill this need. It should look like:
<Post-Damage Eval>
if($gameVariables.value(36) <= 0) {
$gameVariables.setValue(36, 3);
}
</Post-Damage Eval>
That will change the cooldown variable to 3 if it's 0 or less - so, if the passive is active, establish the cooldown of 3 turns. If the cooldown variable is more than 0, it won't do anything. Otherwise the variable will just keep resetting, and the passive will never come off cooldown...
Let me know how that works out for you, or if doesn't work at all I'll take a closer look this evening 😀
😀You can create a passive state "cooldown" using variables. Let's use variable 36, for example. If I'm reading this right, you want a passive on a character that is active until 'used'. Since I don't know exactly how you intend to 'use' this passive, I'll say it is used after an attack and has a cooldown of 3 turns.
Spoiler
<Custom Passive Condition>
if($gameVariables.value(36) <= 0) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
The passive condition will check the cooldown variable. If it's 0, or for some reason less than 0, the passive is not on cooldown and will be active - condition is true.
<Custom Turn End Effect>
$gameVariables.setValue(36, $gameVariables.value(36) -1);
</Custom Turn End Effect>
This will decrease the cooldown variable by 1 turn, at the end of every turn.

<Custom Escape Effect>
$gameVariables.setValue(36,0);
</Custom Escape Effect>

<Custom Victory Effect>
$gameVariables.setValue(36,0);
</Custom Victory Effect>
The above two are what I use as a personal failsafe to reset the cooldown variable when a battle ends by winning or fleeing.

<Custom Battle Effect>
$gameVariables.setValue(36,0);
</Custom Battle Effect>
Same thing, my personal failsafe to ensure the cooldown variable is 0 at a battle start, otherwise the passive may not be active when it should be.

Now, you just have to increase the variable to 3 whenever it is used. If this is being used after an attack, in all the skills you will want a conditional statement similar to what's below, to start the cooldown. You can run a Post-Damage Eval with Yanfly's Skill Core that will fulfill this need. It should look like:
<Post-Damage Eval>
if($gameVariables.value(36) <= 0) {
$gameVariables.setValue(36, 3);
}
</Post-Damage Eval>
That will change the cooldown variable to 3 if it's 0 or less - so, if the passive is active, establish the cooldown of 3 turns. If the cooldown variable is more than 0, it won't do anything. Otherwise, the variable will just keep resetting, and the passive will never come off cooldown...
Let me know how that works out for you, or it doesn't work at all I'll take a closer look this evening 😀

Well, I am using Weapon Unleash.
What I'm doing is that
1 state has the "replace attack: strong attack"
Anytime the user uses the strong attack the passive is on cooldown for 3 turns.
And when is on cooldown it performs quick attack.

So every once in a while, the character has a different option

like poppy auto-attack from league of legends. (Poppy throws her buckler that bounces off the target. Poppy can pick it up to gain a temporary shield.) She's usually a melee champion, but for the moment she becomes a ranged champion.

Or let's say Blue Kayn from LoL, does bonus magic damage for 3 seconds but goes on cooldown for 8 seconds after dealing damage.

What I "really" intend to do. Is to create a skill for one of my characters that anytime they attack they change weapons rotating from different types. Sword, Gun, Gauntlet in that respective order. And by having this passive all it creates an explosive barrel effect so that the player would have to reload. (the sword, gun, gauntlet aren't your normal, they also explosive with powder) And it would have a cooldown and the only way
to reactivate it is by using reload.

I wanted to push away the "use an item/or it takes a variable from a certain source" So, the player is more focused around being more active in
battle.
You really should find a way to not use passives for this, as the definition of passive is, per the plug-in creator, a state that is always present. That cannot be fixed unless you recode how passives work. I'd instead find a way to add whatever you want as a regular state that is not a passive, as that is the better way to do it, and you can use the turn duration for states then, which are ignored in passive states.

I've moved this thread to Plugin Support. Thank you.

You really should find a way to not use passives for this, as the definition of passive is, per the plug-in creator, a state that is always present. That cannot be fixed unless you recode how passives work. I'd instead find a way to add whatever you want as a regular state that is not a passive, as that is the better way to do it, and you can use the turn duration for states then, which are ignored in passive states.
@Renkai141 I'll make a suggestion here. The weapon has an ordinary state that's on it, which has no set duration (ie: it's just on), and never expires, which uses the weapon unleash plugin to do your strong attack. And then make the strong attack remove that state when it is used (in the action sequence works best here), and gives a different state which lasts x turns, and unleashes quick attack instead. After X turns, when the state leaves, it replaces itself with the strong attack state, via a custom leave effect. No passives involved.

Original thread: https://forums.rpgmakerweb.com/threads/passives-with-cooldowns.112440/