MV (YEP) Limited Skill Uses - Replenish Skill uses with another skill

Hi! I'm using Yanfly's limited skill uses plugin and I want to have a skill that recovers the limited uses of another skill.

In this example, I have Skill 1 that has 3 limited uses, and Skill 2 that replenishes the uses of the first.

Here is the Notetag for the first skill (I also have Multi-type plugin hence the Skill Type tag) , this specific skill has two types: Skills and Replenishable1.
1713187854015.png

Second Skill Notetag; What this is trying to do is replenish the limited uses of skill type 10 (Which is Replenishable1 in the Types tab) which the first skill is under of at the cost of additional resources.
1713193086141.png


However, it does not work...
I tried using the global limited uses tag and it does recover the uses, but I don't want it to do so as I want it to only recover this specific skill under Replenishable1 as I may also have other skills that can get recovered but through other various means.

Am I missing something? I might not be understanding the usage of <SType> tag properly...
from what i can see, the limited uses plugin was coded to only look at the skill's directly assigned stype in the editor. adding a skilltype via the multitype plugin wont let the stype tag work with those added types

save this as a .js file, add it directly below the limited skill use plugin, and let me know if theres any issues

Code:
Game_Battler.prototype.getAlterLimitedUses = function(item, user, skill) {
    var value = item.globalLimitedUses;
    skill.skillTypes.forEach(type => {
      if (item.stypeLimitedUses[type])
        value += item.stypeLimitedUses[type];
      }
    )
    if (item.skillLimitedUses[skill.id]) {
      value += item.skillLimitedUses[skill.id];
    }
    value = this.getAltLimitUseEval(item, user, skill, value);
    return value;
};
I see! So hypothetically, the SType limited uses would've worked if I instead:
- Had the skill be mainly have the replenishable skill type , but assign the multitype tag to include the general Skills type, it hypothetically could work because then we'd be referencing the database-assigned Skill type with LimitedUses instead of the one put by Multitype....- yeah no my brain is fried trying to explain this but I hope that may have made sense.

from what i can see, the limited uses plugin was coded to only look at the skill's directly assigned stype in the editor. adding a skilltype via the multitype plugin wont let the stype tag work with those added types

save this as a .js file, add it directly below the limited skill use plugin, and let me know if theres any issues

Code:
Game_Battler.prototype.getAlterLimitedUses = function(item, user, skill) {
    var value = item.globalLimitedUses;
    skill.skillTypes.forEach(type => {
      if (item.stypeLimitedUses[type])
        value += item.stypeLimitedUses[type];
      }
    )
    if (item.skillLimitedUses[skill.id]) {
      value += item.skillLimitedUses[skill.id];
    }
    value = this.getAltLimitUseEval(item, user, skill, value);
    return value;
};

Ah but on a serious note, this worked wonders! I was able to use my skills and recovered limited uses properly, thank you very much!
So hypothetically, the SType limited uses would've worked if I instead...
Absolutely right. if your skills were set to replenishable in the editor, then it would have worked from the start. The downside is that you'd have to change all of your skills from skill to replenishable first, and that might have other impacts within the project

Original thread: https://forums.rpgmakerweb.com/threads/yep-limited-skill-uses-replenish-skill-uses-with-another-skill.167768/