(SOLVED)Different Skill Learn Requirements (YEP_Skill Learn System MV)

Howdy, Sorry if I'm posting in the wrong board, but I've ran into a roadblock regarding the way I want to have certain skills learned. I have what is essentially Red Magic and Black/White magic but for ease of balancing and notetag editing, I have it so where Magic Level Skills are learned on level up at certain milestones, (example: learning Black Magic Level 3 at level 35) which are prerequisites to learn skills through the skill learn system. I could easily just do this by having the classes learn skills upon level up and not require learning them via the Skill Learn System but this is the only way I can think of to mimic the way you learn spells in Bravely Default/Second. Plus, it saves me a lot of hassle with having to set levels for skills individually. But here's where the Red Magic thing comes in: I have completely separate skills for Red Magic levels (mostly for consistency's sake and because I want to give the Red Mage of the game some unique flavor instead of just being low level B/W magic) I tried a notetag to see if that would work initially, but that didn't work. So I've been stumped for weeks.

Here's the big issue though: I'm completely inept at Javascript. I can't even learn Lua, that's how bad I am with coding. I only know two friends who know Javascript but one's too busy and the other hasn't used Javascript in a long while, let alone with knowledge of RPG Maker MV's calls. So I was wondering what calls I could use to make this myself or if anyone could figure this out. I'd appreciate if anyone could help me figure this out greatly.

I've included a screenshot of what I mean by "Prerequisite skills" as well for clarification. They don't even have a function beyond this.

Edit for further clarification: What I mean by all of this is that I'm trying to have it to where one of two skills are required. I should've clairified this earlier but I'm ungodly tired.
Edit for further clarification: What I mean by all of this is that I'm trying to have it to where one of two skills are required.
Try putting something like this in your skill's notebox:
JavaScript:
<Learn Require Eval>
var req = [100, 101, 102];
value = req.some(function(id) {
  return user.isLearnedSkill(id);
});
</Learn Require Eval>
This should return "true" (i.e. "requirements met") iff the actor in question has learned skill 100, 101, or 102. You can add/remove numbers from the var req line as needed. 🙂

If you need a threshold kinda thing, e.g. "at least 2/3 of these skills required", you can try something like this instead:
JavaScript:
<Learn Require Eval>
var req = [100, 101, 102];
value = req.reduce(function(count, id) {
  return count + (user.isLearnedSkill(id) ? 1 : 0);
}, 0) >= 2;
</Learn Require Eval>
This counts the number of skills the user has learned out of those in the list, then (on the last line) compares that count to see if it's at least 2.

In case you're interested in technical details of the array functions I've used in these snippets, here are links to relevant articles on MDN: Array, some, reduce.

(Incidentally, I feel JavaScript is easier than Lua, but then again I have more experience with JS. 😛)
Try putting something like this in your skill's notebox:
JavaScript:
<Learn Require Eval>
var req = [100, 101, 102];
value = req.some(function(id) {
  return user.isLearnedSkill(id);
});
</Learn Require Eval>
This should return "true" (i.e. "requirements met") iff the actor in question has learned skill 100, 101, or 102. You can add/remove numbers from the var req line as needed. 🙂

If you need a threshold kinda thing, e.g. "at least 2/3 of these skills required", you can try something like this instead:
JavaScript:
<Learn Require Eval>
var req = [100, 101, 102];
value = req.reduce(function(count, id) {
  return count + (user.isLearnedSkill(id) ? 1 : 0);
}, 0) >= 2;
</Learn Require Eval>
This counts the number of skills the user has learned out of those in the list, then (on the last line) compares that count to see if it's at least 2.

In case you're interested in technical details of the array functions I've used in these snippets, here are links to relevant articles on MDN: Array, some, reduce.

(Incidentally, I feel JavaScript is easier than Lua, but then again I have more experience with JS. 😛)
Thank you so much! You're a life saver!

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/solved-different-skill-learn-requirements-yep_skill-learn-system-mv.116586/