How do I make a skill that will only work against a specific type of enemy?

How do I make a skill that will only work against a specific type of enemy? For example, I have a type of enemies, robots, and I need skills like hacking, etc. to work only against them.
make the skill a damage element like "robots only" and give all other enemies a trait 0% damage from "robots only" element
@Andar: How do you protect other enemies from States applied by "robots only" elemental skills, such as Sleep (from Shut Down skill) or vulnerability to Hydro damage (applied by Expose Circuitry skill)?
You can just give them State Resist to it in their Traits.
You can just give them State Resist to it in their Traits.
Got it thanks. So you might have to clone a few states and give them a custom name, so enemies would be immune to the new cloned versions.
as with the damage, give them a trait to be immune to those states
edit: ninja'd
And to be clear, there are other approaches - you could use a plugin to prevent these skills from being able to target non-robot enemies at all, which might be much better from a player UX perspective.

It's hard to make any plugin recommendation because it's not clear what you're asking for - you posted this in MV Support, but your profile says you use MZ.

But what Andar describes is a way for you to implement this just using the default engine.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-skill-that-will-only-work-against-a-specific-type-of-enemy.166558/