Add random Skill in certain State

How to add random skill when at certain state. Yes i can add skill not randomly in state traits. But i want to add skill randomly at every turn to make it rng.

Is there any way to add skill randomly using script at certain state?



random skill help pls 2.jpg



I Use rpg maker mv and Yanfly Free.
Make a state for each skill, and instead of a random skill, apply a random state when you apply the state.
it can't be done by script alone.

you'll need a plugin to change how states are handled to give the engine the ability of executing a state notetag on apply, and then place the effects you want as script code into the notetag of the state.
Thank you everyone for replying sorry for late reply cus i try to implement it.


Okay so I use yanfly passive state and notetag to make it works. but the problem is

1. passive state doenst change when Variable is changing in mid of battle. i try to change it at start turn and end turn of battle the state condition doenst change at all.
Example
State 1 condition is variable X more than 50
State 2 condition is variable X less than 50

i Try to change Variable X (to become random between 30 and 70) in troop and end turn event. But state 1 and state 2 doenst appear or dissapear. Its just state 1 that appear in the start of battle cause Variable X is 70 at start of battle.





what i want in my game is kinda rng skill style. At start of player turn, player get 8 random skill to choose like this.

Skill at turn 1 (3 skill appear)
SKill in turn 1.jpg


Skill at turn 2 (5 skill appear)
Skill in turn 2.jpg


Skill at turn 3 (0 skill)
0 skill.jpg


maybe this explanation will make it clear sorry if this kinda makes it more confusing.

Original thread: https://forums.rpgmakerweb.com/threads/add-random-skill-in-certain-state.180739/