making a skill attack both random enemies and random allies

Let's say I want a spell to be cast on 3 random targets, which could be either enemies or allies.  Is there a way to do this either with the default program or the damage formula, or would I need a plugin for this?

NOTE:  i don't want the user to be a possible target of the spell.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-skill-attack-both-random-enemies-and-random-allies.50966/