Making a skill hit X enemies with no repeats?

Maybe that title is confusing... so let me explain, ive made a skill with "2 random enemies" as its scope, but if you're fighting only 1 enemy the skill will hit the same enemy twice. I know this is working as intended, but how can i make it so it will only attack each random enemy once?

I've been googling this and apparently theres a Yanfly plugin that fix this... but this is just for a game im making as a hobby, so i will not be buying any plugins. Can I get around that somehow?
You could go around it by applying a state to your target on hit, then check for the said state in your formula. If the state is applied, you deal no damage, if it is not applied, you deal damage normally.

The formula would look somewhat similar to this:
JavaScript:
b.isStateAffected(yourStateId) ? 0 : yourDamageFormula;

EDIT: Don't forget that the state should not last, so remember to remove it at the end of turn. If you don't, your attack is not going to deal any damage for the rest of the battle.
You could go around it by applying a state to your target on hit, then check for the said state in your formula. If the state is applied, you deal no damage, if it is not applied, you deal damage normally.

The formula would look somewhat similar to this:
JavaScript:
b.isStateAffected(yourStateId) ? 0 : yourDamageFormula;

EDIT: Don't forget that the state should not last, so remember to remove it at the end of turn. If you don't, your attack is not going to deal any damage for the rest of the battle.
Sorry for the late reply, but i just tested it and it works like a charm! thank you so much
This will stop an enemy from being hurt by the attack more than once, but it won't actually force the skill to divide its attacks against different enemies.

The Yanfly action sequence plugins are free.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-skill-hit-x-enemies-with-no-repeats.138582/