Help with Target Scope?

So I was testing out battles to balance out my skills and vary them and I ran into a problem that I can't seem to figure out myself. I'm trying to make everyone's basic attack actually worth using in certain situations. But the way the targeting scope works it's making having a basic attack pretty redundant. I have Yanfly's Target Manager and that still doesn't seem to offer me any help. For example, I have one skill that is supposed to target 3 random enemies, and it does less damage than a regular attack. But when there is one enemy left it just ends up attacking them with it 3 times. Which is completely disrupting what I want. So how can I make it so it targets 3 random targets if there is 3+, only 2 if there is 2 left, and only one if there is one left. On a second note, is there a way to make it so it DOESN'T attack the same target more than once? Occasionally, it'll target the same person multiple times. If anyone could point me to script, a way to event around, or any sort of solution would be amazing. Thanks for reading.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


I'm moving this to Script Support in the assumption that you are using Yanfly's script for this as well as for other things, so the solution should be a mod to the script. However if you only have this script to solve THIS problem, say so, and someone might be able to write something new for you and you won't need the script at all.


Please post a link to the script so it's easy to find (don't copy and paste the script itself here).
Oh I'm sorry, I am ONLY using this script to circumvent this particular problem which is not working. I would like to do without the script and not add to it, if possible.

https://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/target-manager/ That's the script I was referring to, as it was really the only one I was able to find myself that actually switched the targeting scope.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-target-scope.53273/