Equipment Learning

Equipment Learning by Moogle_X, he was a "Lunatic Code" in this plugin. But according to a post its code JavaScript:
Spoiler: Post
Sorry, my eval is not really "friendly" compares to Yanfly.
You need to write the code just like you would code the JavaScript directly.

<EQL AP Gain Eval>
this.hp -= this.mhp * 0.1;
</EQL AP Gain Eval>

Some tips:
  • this // The actor who gain the AP.
  • $dataSkills[x] // Skill with id x.
  • $dataSkills[x].eqlShowSwitch // Skill x's binded switch id.
  • this.forgetSkill(x) // Forget (and also reset AP to 0) skill with id x.
  • this._eqlAp[skillId] = 0; // Only reset AP to 0.
  • this._eqlAp[x] // Skill x current AP.
  • this.eqlIsMastered(skillId) // Is this actor "mastered" or learned the skill?


I don't know any javaScript, but i need a code like this:

Spoiler: Code
<EQL AP Gain Eval>
if (this.eqlIsMastered(610)){
value = true;}
else{
value = false;
}
</EQL AP Gain Eval>


What i mente is a code that prevent Skill (611) to gain any AP until Skill (610) as ben "mastered"
Try this:
<EQL AP Gain Eval>
var skillid = 611;
if (this.eqlIsMastered(610)){
this._eqlAp[skillid] += x;
}else{
this._eqlAp[skillid] = 0;
}
</EQL AP Gain Eval>
And place this code on skill 611.
Where x is the amount you want to gain.

Original thread: https://forums.rpgmakerweb.com/threads/equipment-learning.91357/