Make certain enemies start battle with certain states

Using troop events for that everytime is pretty tedious. Well I know there is yanfly's auto passive states, but those are permament/conditional, I want them to be removable by ordinary ways. Also, if possible, enemies should get statuses not only at the start of the battle, but if they appeared mid battle aswell (using HIME_Reinforcements). Able to add random would be nice aswell, like using tag on enemy <states: 1,2,3> and it will appear with either state 1, 2 or 3.
You can give them a passive state that has a battle start effect from Yanfly's Buffs & States to apply a regular state (or one of several, randomly chosen).

But I think setting all of that up is an equivalent amount of work to just making a troop event.
That seems better actually, but I can't make it work.. Passive state by itself is appearing, but regular state don't. Tried those in passive tag:

<Custom Battle Effect>
var a = Math.random();
if (a <= 0.33) user.addState(11);
else if (a >= 0.66) user.addState(12);
else user.addState(13);
</Custom Battle Effect>

<Custom Battle Effect>
user.addState(11);
</Custom Battle Effect>
Passive state by itself is appearing, but regular state don't
both of those should work if thats how they are in the notebox for your passive state. do you by chance have any plugins that heavily modify how combat is handled?
Ah I see, that was because YEP_BattleEngine was above YEP_CoreEngine, now that I swapped them it works. Battlers positions became messed up tho, but anyway solved, thanks.

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/make-certain-enemies-start-battle-with-certain-states.165824/