Skills: Reversing the cooldown concept to incremental increases

Hi, I'm still new to RPG Maker because I haven't spent a huge amount of time with it, and I'm not even sure how to ask my question.

I want to create a "warm up" system for skills (as opposed to a cooldown). Each skill would have a boost number that starts at 0 at the beginning of battle and increases +1 at the end of each round of combat or at the beginning of the player turn. For example, Fireball deals 5 + X damage where X is that skill's boost value. So starting the third round of combat, you use Fireball, dealing 8 damage (5+3), then the boost gets set back to 0. I'm also thinking there should be a hard cap, across the board, so there's no infinitely growing numbers.

The rub is I want this boost number to be individually tracked per skill and be able to be manipulated. For example, an armor could give a random skill an extra +1 to boost each turn, a weapon could increase the physical skills by +2 and decrease magic skills by -1 each turn, a skill could increase another character's boost by +1 across all their skills, etc.

My question is this: Is what I'm describing even possible in MV? If so, how do I get started learning how to do this? If not, I'd rather know now than waste a ton of time invested into MV when I could be building it in another (albeit, more difficult) game engine.
My question is this: Is what I'm describing even possible in MV?
The entire source code of the engine is sitting in the js folder of every project you start. So literally anything is possible, if you have sufficient knowledge and put sufficient time and effort into it.

This is not super high on the difficulty rating.

If so, how do I get started learning how to do this?
Well, what do you know? It always makes sense to do tutorials and practice games and learn how to use MV, its event system, and how it works by default before you start making major modifications for your personal project.

If you specifically want to learn how to do this, you'd do JavaScript tutorials until you're sufficiently skilled to write a plugin that implements this.

If you want help from others to do this, just ask.

My question would be, how do you want to indicate this to the player? The only thing I can think of would be using Yanfly's Skill Core to display the skill's charge variable as an additional cost, and you use a code evaluation to make the cost always be the number of charges you have.

Or you make an entirely new UI element.
It's not difficult to do the basics of this with some js know-how, but I suppose that's the crux of this post.
And as @ATT_Turan put it, if you need the buildup info communicated to the player, that's a whole other thing.

This plugin has warmup functionality, including notetags for equipment that influence the warmup time. You could incorporate the warmup property added by this plugin into your skill damage formulae, and can manipulate it via scripting for resetting on use.

Edit: Though that would need some tweaking as it just occurred to me that you don't actually want a warm-up system where you can't use the skill until after X turns have passed, you just want a ramping bonus that resets when you use a skill.
Edit: Though that would need some tweaking as it just occurred to me that you don't actually want a warm-up system where you can't use the skill until after X turns have passed, you just want a ramping bonus that resets when you use a skill.
Exactly why I didn't suggest the YF plugin. ☺️
Thanks for all the replies!

I kinda put this idea on the backburner for a while and focused on learning more about the MV system as a whole. The question felt a bit of an overexcited bit-off-more-than-I-could-chew moment when I asked it, so I decided to go back and work more on understanding the basics since I haven't touched MV in a very long time and apparently forgotten everything I used to know.

Yanfly's cooldowns did come to mind when I posted this, but I didn't think it would work because of how it prevents the use of a skill. So I didn't think that would work for what I want to accomplish, exactly, as others pointed out.

I recently went back to the idea because now that I have the maps and dungeon generation done for my project, I need to build the battle system and make sure it's functional and, more importantly, fun. This is a learning project, though, so if I can't figure it out, I'll just use some other method until I CAN figure it out.

I was hoping there was a way to give each skill some kind of variable individual to the skill. If so, I could just use the Turn End event trigger in battles to increase everything +1 and the skills would just reset their own variable to 0 once used. Not sure if that makes sense yet. I'm still learning all this, so thank you all for the help!
You can give each actor a passive state with the following code:
Code:
<Custom Turn End Effect>
user.skillCounters = user.skillCounters || [];
user.skills().forEach(skill => {user.skillCounters[skill.id] = user.skillCounters[skill.id] || 0; user.skillCounters[skill.id] = Math.min(user.skillCounters[skill.id], 10)});
</Custom Turn End Effect>

That will give each actor a skillCounters array, where the array index of the skill's ID is its current charge count, and they all increment at the end of each turn to a maximum of 10 charges.

Then you can reference and use it as I mentioned in my previous post. Or however...you never answered the questions about how you'd want it displayed.
Oh, sorry. As far as how it's displayed, I actually wanted it to be displayed similar to MP/TP costs, just a number adjacent to the skill name. I'm calling it Momentum, so in my mind's eye, it's just displayed as (X)M. I'm not going to be using MP or TP at all, though, so this is the only cost I'm concerned with.

Thanks for the code! And...maybe a dumb question, but where would I put this, exactly? And if I understand this right, if the limit of 10 is too high or too low, all I'd need to do is change the 10 at the end of the second line to change the max number of charges, right?
where would I put this, exactly?
You can give each actor a passive state with the following code:
If you're not sure what that means, go ahead and download Yanfly's Auto Passive States and read through the instructions.

And if I understand this right, if the limit of 10 is too high or too low, all I'd need to do is change the 10 at the end of the second
Correct.

I actually wanted it to be displayed similar to MP/TP costs, just a number adjacent to the skill name.
So then what I said above about adding it as a cost via Yanfly's Skill Core is just right.
Perfect. I'll download the plugin and look through it. You've been a massive help! Thank you!
@ATT_Turan So I'm still having trouble with implementing this idea. I did a copy/paste for the code you gave me on the first actor, then put the following in the skill's note box (with Yanfly's Skill Core and Auto Passive States installed):

Code:
<Cost Display Eval>
var variableId = 4;
var value = skillCounters;
$gameVariables.setValue(variableId, value);
</Cost Display Eval>

<Custom Cost Display>
\c[0]\v[4]\c[0] Momentum
</Custom Cost Display>

Variable 4 is the turn counter, which gets a +1 increase at the end of each battle turn (1-3 are used for a different function). This setup does display the Momentum cost as the value of the turn counter, but it doesn't cap at 10 and it doesn't reset to 0 after the skill is used. I've played around with changing numbers and variable ids, but I'm missing something here. What am I missing?

EDIT for clarity: Everything else is just default assets and such currently. I've changed the variableId to different variables, which always resulted in a 0 being displayed as cost. I changed the custom cost as \v[skillCounters] which only displayed the text [skillCounters] and I realized that was because it needed to reference an actual variable ID.
I did a copy/paste for the code you gave me on the first actor, then put the following in the skill's note box
Erm...I don't really get what you're going for with those notetags.

You seem to be trying to duplicate the effect of the code I already made for you and combining it with how the cost is displayed.

But just to help by going through a few things:
var variableId = 4;
That doesn't serve any purpose - you only use this one time and you don't manipulate the value at all. Just type the number 4.

var value = skillCounters;
This will result in a value of undefined - there's no global variable called skillCounters.

$gameVariables.setValue(variableId, value);
You can just type $gameVariables.setValue(4, value) and it's both fewer keystrokes and one less line of code 😉

Variable 4 is the turn counter, which gets a +1 increase at the end of each battle turn
You don't need that, you can directly access the turn number if you look up the script call. But you don't need that because I already gave you code that increments all of the actor's skill charges every turn. I don't see how the battle's turn number is relevant.

I did a copy/paste for the code you gave me on the first actor
Just to double check, you mean you pasted the code I gave you into a passive state that you put on the first actor?

Anyway, as far as implementing this, I already supplied the above:
That will give each actor a skillCounters array, where the array index of the skill's ID is its current charge count, and they all increment at the end of each turn to a maximum of 10 charges.
Given that, you can put this in a skill:
Code:
<Cost Display Eval>
$gameVariables.setValue(4, user.skillCounters[skill.id]);
</Cost Display Eval>

<Custom Cost Display>
\c[0]\v[4]\c[0] Momentum
</Custom Cost Display>

<Custom Execution>
user.skillCounters[skill.id] = 0;
</Custom Execution>

That sets variable 4 to have the number of charges accumulated for the current skill; displays that number of charges as the skill's cost (since it will always consume all charges when you use the skill); and then actually resets it to 0 in the user's skillCounters array when the skill is used.

Edit: I just went all the way back to your first post and noticed you specified that all skills should start at 0 charge at the beginning of the battle. So you'll need to modify what I gave you for the passive state initially. Change it to have this:

Code:
<Custom Battle Effect>
user.skillCounters = [];
user.skills().forEach(skill => user.skillCounters[skill.id] = 0);
</Custom Battle Effect>

<Custom Turn End Effect>
user.skillCounters.forEach(charge => charge = Math.min(charge+1, 10));
</Custom Turn End Effect>
Okay, so I clearly didn't understand some of this lol. In hopes of avoiding miscommunication, I'll describe exactly what I've done now.

I did create a state (id 11), pasted in your code in the Note box, and put in the note of the actor "<Passive State: 11>" (which I originally did not do properly).

I deleted the extraneous code from the cost eval in the skill's note. It was something I got from the lunatic mode instructions, so I assumed it was necessary and I spent time trying to figure out what it did before coming back for help.

I pasted in the custom execution you provided into the note for the skill.

I deleted the Battle Event - Turn End that added +1 to Momentum (so variable 4 is now empty).

Result: Skill cost stays displayed at 0 and does not increase with turns.

I'm not trying to just get an easy answer, and I'm sorry if it seems that way. I want to understand why these things work how they do so I can troubleshoot myself later.
Please post screenshots of the state and skill.

If you assign an icon to state 11, do you see that icon on the actor in battle, confirming they have the passive state correctly?

If you press F8 and go to the Console tab during the game, are there any errors?

Edit: it was my mistake. Change this notetag:
Code:
<Custom Turn End Effect>
user.skillCounters.forEach((charge, index) => user.skillCounters[index] = Math.min(charge+1, 10));
</Custom Turn End Effect>
Okay, so I did assign an icon to the passive state, and it does show in battles. I also changed the notetag as you instructed. I've included screenshots of the skill, passive state, and f8 console when I run the game and get into a battle. That battle screenshot was the third turn, so it's not increasing each turn.

Passive State.png
game run.png
Skill 1.png
Skill 2.png
Can we see your updated battle start and turn end tags?
That is not the Console tab. There's no useful information in the Elements tab.
That is not the Console tab. There's no useful information in the Elements tab.
Sorry, this is the Console tab.
console.png
Your passive state appears to be missing the Custom Battle Effect that actually creates the array on the actor.

Without that, the other notetag to increase the skill charges in the array will do nothing because...it doesn't exist.

Original thread: https://forums.rpgmakerweb.com/threads/skills-reversing-the-cooldown-concept-to-incremental-increases.164960/