MV [YEP_SkillMasteryLevels] Change How Use Cumulation Works

I've run into many headaches with Skill Mastery Levels which all stem from one simple fact. When skills level up, the usesare set back to zero, and the number of uses necessary to level is based only from one level to the next. If at all possible, I would like to change the plugin so that usesdo not reset, and usesneeded to level up is calculated based the on life time usesnecessary. This would allow the same formulae to be used for both Mastery Levels and disciplinelevels in YR_ItemCrafting.
I would like to change the plugin so that usesdo not reset, and usesneeded to level up is calculated based the on life time usesnecessary.
havent tested it myself, but it looks like this should do
Code:
Game_BattlerBase.prototype.gainSkillMasteryLevel = function(skillId, value) {
  this.checkSkillMasteryLevels();
  this._skillMasteryLevels[skillId] = this._skillMasteryLevels[skillId] || 0;
  this._skillMasteryLevels[skillId] += value;
  this._skillMasteryLevels[skillId] = this._skillMasteryLevels[skillId].clamp(0,
    $dataSkills[skillId].masteryMaxLevel);
  this.updateSkillMasteryUsageMax(skillId);
};
Game_BattlerBase.prototype.setSkillMasteryLevel = function(skill, value) {
  if (DataManager.isSkill(skill)) {
    var skillId = skill.id;
  } else if (typeof skill === 'number') {
    var skillId = skill;
  } else {
    return 0;
  }
  this.checkSkillMasteryLevels();
  var level = value.clamp(0, $dataSkills[skillId].masteryMaxLevel);
  this._skillMasteryLevels[skillId] = level;
  this.updateSkillMasteryUsageMax(skillId);
};
havent tested it myself, but it looks like this should do
Code:
Game_BattlerBase.prototype.gainSkillMasteryLevel = function(skillId, value) {
  this.checkSkillMasteryLevels();
  this._skillMasteryLevels[skillId] = this._skillMasteryLevels[skillId] || 0;
  this._skillMasteryLevels[skillId] += value;
  this._skillMasteryLevels[skillId] = this._skillMasteryLevels[skillId].clamp(0,
    $dataSkills[skillId].masteryMaxLevel);
  this.updateSkillMasteryUsageMax(skillId);
};
Game_BattlerBase.prototype.setSkillMasteryLevel = function(skill, value) {
  if (DataManager.isSkill(skill)) {
    var skillId = skill.id;
  } else if (typeof skill === 'number') {
    var skillId = skill;
  } else {
    return 0;
  }
  this.checkSkillMasteryLevels();
  var level = value.clamp(0, $dataSkills[skillId].masteryMaxLevel);
  this._skillMasteryLevels[skillId] = level;
  this.updateSkillMasteryUsageMax(skillId);
};
1750252608778.png


Edit: This apparently failed because I set the formula to level ^ 2. Setting it to something normal like level * 5works.
level ^ 2
for js, its
Code:
level**5
, not
Code:
level^5

Original thread: https://forums.rpgmakerweb.com/threads/yep_skillmasterylevels-change-how-use-cumulation-works.178396/