MV Basic Attack Skill Producing Random Effects(On Use)

Time is unfortunately not on my side today, so I will be as brief as can be.

One Character I have designed wields Tarot Cards in battle-and Attacks with them. Through the use of Yanfly's Weapon Unleash Plugin(Which contains a neat "Weapon Attack Replace" function) I have managed to give these Tarot Cards an unique Basic Attack Skill-but that alone is not enough. I would like for this Basic Attack Skill to produce varying effects out of a list, to represent each Tarot: The Effects can range from simply altering the Element of the Attack to outright modifying the Damage Formula itself. Or Adding States/Debuffs if the Attack Hits.

I would like for the Attack's Effects to be chosen at random when the Battler's Turn Action(Ergo, the Attack Skill in question) is being Executed.

Example Given:
  1. Battler Attacks with the Tarot Attack Skill. The Game chooses from the list of potential effects, returning a "Fire" Tarot Attack that changes the Element of the Attack to Fire, changes the Animation of the Attack to a Fire-Elemental one and adds a 10% chance of inflicting the "Burn" State.
  2. Then, the Battler Attacks with the Tarot Attack Skill once again when their turn comes back up. This time, the Game chooses a "Poison" Tarot Attack that changes the Element of the Attack to deal Non-Elemental Damage and adds a 25% chance of inflicting the "Poison" State.
  3. Their turn comes back up a third time. The Battler attacks in the same way again. For the third effect the Game returns out of the list of effects each Tarot can yield, it is a "Heal" Tarot that restores some of the Battler's HP through a different formula than the one used to Deal Damage, complete with Animation Change.

I was initially hoping not to require the aid of Plugins in this specific case... I do not think that is happening for it will probably make my work a lot harder not to.

For additional Reference, I am using the Full Collection of the Yanfly Engine.

(Smaller Note: This Skill is intended to be used by One Actor and a certain Enemy.)
It can probably be done in an action sequence, but thatll be a very large one since itll have to contain every effect of every skill. Truth be told, i dont really use them that much either, so i wont give advice on that.

Something i know you can do though is have your tarot attack skill via weapon unleash, have each outcome as a separate skill, and then have the tarot attack be used to set your target, handle the rng, and call the correct outcome skill afterwards.

JavaScript:
//Tarot Skill
<After Eval>
var cards = [1554,1555,1556]; //list of outcome skills
var card = cards[Math.floor(Math.random()*cards.length)]; //pick one at random

BattleManager.queueForceAction(user, card, target); //user uses the random skill on the target chosen
</After Eval>

note: even if your self heal is chosen, itll be used on the user even if it looks like the code wouldnt allow it
Something i know you can do though is have your tarot attack skill via weapon unleash, have each outcome as a separate skill, and then have the tarot attack be used to set your target, handle the rng, and call the correct outcome skill afterwards.

JavaScript:
//Tarot Skill
<After Eval>
var cards = [1554,1555,1556]; //list of outcome skills
var card = cards[Math.floor(Math.random()*cards.length)]; //pick one at random

BattleManager.queueForceAction(user, card, target); //user uses the random skill on the target chosen
</After Eval>

note: even if your self heal is chosen, itll be used on the user even if it looks like the code wouldnt allow it

I am at a loss as to how you have managed to make it so simple and work like a charm. I have just tested it-still testing it right this moment-But it is producing exactly the desired results. I am in your debt yet again! :LZSjoy:
Code:
var card = cards[Math.floor(Math.random()*cards.length)]; //pick one at random
Just as a mention - this obviously works just fine, but you could save yourself some effort with RPG Maker's randomInt() function.

Code:
cards[Math.randomInt(cards.length)]

Original thread: https://forums.rpgmakerweb.com/threads/basic-attack-skill-producing-random-effects-on-use.163260/