learned skill eval help

ok, so I'm using yanfly shades of black skill.



<After Eval>
// Create the pool for random basic skills that can be used.
var tier1skills = [];
tier1skills.push(601, 641, 681, 721, 761);
tier1skills.push(801, 841, 881, 921, 961);
// Create the pool for random advanced skills that can be used.
var tier2skills = [];
tier2skills.push(609, 649, 689, 729, 769);
tier2skills.push(809, 849, 889, 929, 969);
// Calculate the chance for a basic skill
if (Math.random() < 0.88) {
// Get a random skill ID from the basic pool
var skillId = tier1skills[Math.floor(Math.random() * tier1skills.length)];
// Otherwise
} else {
// Get a random skill ID from the advanced pool
var skillId = tier2skills[Math.floor(Math.random() * tier2skills.length)];
}
// Set this action's skill to the action
this.setSkill(skillId);
</After Eval>

// Action Sequence to determine random skill used for Magick
<Setup Action>
clear battle log
display action
immortal: targets, true
perform start
wait for movement
cast animation
wait for animation
action effect
clear battle log
display action
</Setup Action>



I'm trying to make the skill look through the skills the actor actually knows and cast one of those, instead of a random array of skills.
making several of the same skill won't work because of the nature of how I want skills to work.

<After Eval>
user.isLearnedSkill(3, 4)
// Set this action's skill to the action
this.setSkill(3, 4);
</After Eval>


thats all ive come up with but i know its wrong .

any help is appreciated.
I can't help you much with the Yanfly functionality but based on the javascript shown if I was to modify the eval to use the actor's skills I would use something like this:

Code:
<After Eval>
var skills = user._skills.concat(user.addedSkills()); // create array containing all user's skill ids
this.setSkill(skills[Math.randomInt(skills.length)]); // set skill using a random value from array
</After Eval>

Original thread: https://forums.rpgmakerweb.com/threads/learned-skill-eval-help.115427/