Limited Skill Uses (Resolved)

Good morning,
I use the yanfly plugin "Limited Skill Uses" and I would like to have a little more possibility in my game. The yanfly explanations allow you to reload the use of skills at the end of a fight for example, but is there a script for directly recharge a single unit of a specific ability of a specific hero?
This will allow me to create passive effects like "at the end of each turn, recharge one use of skill X if you have less than 25% HP"
Or even active effects like a skill that recharges other skills.
I will manage afterwards to create what I want, but I need to know if such a script exists before inventing effects.
Thanks to those who help me ^^
There's battler.setSkillLimitedUse(skillId, value)

So you could put in a state notetag:
Code:
user.setSkillLimitedUse(69, user.skillLimitedUseCurrent(69)+1);

to restore one use of skill ID 69.
Thank you very much for your answer, it looks like what I'm looking for but it doesn't work. I forgot to mention that even if I use a lot of script, I don't understand much about it, I just copy what I find ^^"
I entered the following script: user.setSkillLimitedUse(109, user.skillLimitedUseCurrent(109)+1);;
This does not seem to recharge skill 109 by one unit.
Aren't I supposed to specify the actor ID somewhere?
I probably did something wrong.
Please paste the entire notetag. There's no need for two semicolons at the end, but that shouldn't break anything.

Aren't I supposed to specify the actor ID somewhere?
No, user is a reference to the actor, there's no part of that function call that expects the actor's ID.
I don't understand, I copied the entire note label. Perhaps you read my message before I edited it, I had in fact copied incorrectly on the forum what I had put in my game, sorry.
Maybe I didn't copy the note label in the right place? In fact, I don't necessarily want to link this effect with a specific ability (I will do it too but I want to have several possibilities).
For the moment I have copied your solution in a state that I give to my character and that I immediately remove from him to do tests.
I put this in the state:
Code:
<Custom Apply Effect>
user.setSkillLimitedUse(109, user.skillLimitedUseCurrent(109)+1);
</Custom Apply Effect>

Something is happening but it's not working the way I want it to.
If the capacity is 3/3, it goes to 0 after applying the state.
At 2 ==> 0
At 1 ==> 1
At 0 ==> 2

What I would like is only to gain +1 each time (and with no effect if the capacity is already at maximum).
I get the same result by replacing user with target
Something is happening but it's not working the way I want it to.
If the capacity is 3/3, it goes to 0 after applying the state.
setSkillLimitedUse() works nearly inverted to how you are thinking of it. it doesnt set the numbers of available uses to that number, it sets the number of times the skill was considered used. if your skill has 3 max uses and you use that function to increment the current uses available by only looking at the number of current uses are remaining and adding 1, then you set it to having being considered used one more than however many remaining times you have. so 3 charges becomes 0 because you "used" it 4 times, 2 becomes 0 because you "used" it 3 times, 1 stays 1 because you "used" it 2 times, and 0 becomes 2 because you "used" it once
try this:
Code:
user.setSkillLimitedUse(109, user.skillLimitedUseMax(109)-(user.skillLimitedUseCurrent(109)+1));
Thank you for your answer. I understand better why it didn't work. I'll try your solution when I get home from work and let you know.

I would like to take this opportunity to ask a second thing. I don't know if it's helpful to open a new topic for this since the problem is similar. In my project, each hero has a particular way of playing. Another character of mine uses powerful abilities with Yanfly's Cooldown system. I would like to know if there is a similar script that allows you to speed up a cooldown by one unit.

I give an example: I have a skill very powerful but with a cooldown of 6 turns. But this cooldown is reduced by 1 turn each time my hero inflicts a critical hit (or by another condition, whatever). What is the script that allows you to reduce an ongoing cooldown by 1 unit on a specific ability? If you can help me with that too that would be perfect ^^
setSkillLimitedUse() works nearly inverted to how you are thinking of it. it doesnt set the numbers of available uses to that number, it sets the number of times the skill was considered used.
Ah, thanks! Hah, that was my bad.

I don't understand, I copied the entire note label.
No, you had the code but not what you were using for an actual notetag. That's still what it shows in Post #3, so no editing was involved.

What is the script that allows you to reduce an ongoing cooldown by 1 unit on a specific ability?
Code:
user.addCooldown(skillId, -1);
where skillId is the ID of the skill, no leading zeros.
No, you had the code but not what you were using for an actual notetag. That's still what it shows in Post #3, so no editing was involved.
I think I misunderstood you ^^"

In any case, I tried the scripts you suggested, both work perfectly as I want them to.
Thank you both for your help ^^ this will give me a lot more possibilities to create interesting gameplay =)

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/limited-skill-uses-resolved.162784/