In my game, I'm using the titular plugin to give physical skills a cooldown. Also in my game, the party is fully healed and restored after every battle. I'd like this to apply to cooldowns as well.
However, it seems there's no option to set every skill's cooldown to 0 after a battle, only an option to reduce the cooldown by a set amount of turns. I could do this, especially I'm not planning on giving any particular skill a cooldown greater than 10 at the moment, but 1. this leads to skills for which I'm not giving cooldowns an internal cooldown of -10 and below. It's not noticeable for players, but it's certainly making me wary, and 2. On the off chance I'd want to give a skill a cooldown greater than 10, I'd have to adjust the parameter again.
So I'm trying to seek a way of ensuring all cooldowns are set to 0 after a battle, regardless of what their remaining turn count was.
My first attempt looked something like this:
It didn't seem to do anything. It's not throwing any errors, but it doesn't affect the cooldowns at all. Furthermore, it told me that the length of the array I'm trying to reference is "undefined" (for the record, the actor in question had 6 skills). I haven't put this into an event or anything yet; this was done through the developer's tools window.
And this is where my lack of scripting experience starts showing itself. Would someone better versed in this than me provide some pointers as to what I'm doing wrong, please?
However, it seems there's no option to set every skill's cooldown to 0 after a battle, only an option to reduce the cooldown by a set amount of turns. I could do this, especially I'm not planning on giving any particular skill a cooldown greater than 10 at the moment, but 1. this leads to skills for which I'm not giving cooldowns an internal cooldown of -10 and below. It's not noticeable for players, but it's certainly making me wary, and 2. On the off chance I'd want to give a skill a cooldown greater than 10, I'd have to adjust the parameter again.
So I'm trying to seek a way of ensuring all cooldowns are set to 0 after a battle, regardless of what their remaining turn count was.
My first attempt looked something like this:
Code:
for (var i = 0; i < $gameActors.actor(1)._cooldownTurns.length; ++i)
{
if ($gameActors.actor(1)._cooldownTurns[i] > 0)
{
$gameActors.actor(1)._cooldownTurns[i] = 0;
}
}
It didn't seem to do anything. It's not throwing any errors, but it doesn't affect the cooldowns at all. Furthermore, it told me that the length of the array I'm trying to reference is "undefined" (for the record, the actor in question had 6 skills). I haven't put this into an event or anything yet; this was done through the developer's tools window.
And this is where my lack of scripting experience starts showing itself. Would someone better versed in this than me provide some pointers as to what I'm doing wrong, please?