Contact Damage and Status Effects Upon Contact

Hey there. So, let's say I wanna make a spiky enemy like, say, an urchin. I'd like to have it where a player who makes contact like, say, a warrior get damaged when hitting the thing. At the same time, I'd like to have it where an archer, whose attacks are ranged physical attacks (if there's a way to make an archer's normal attack do that, please tell me), NOT receive contact damage.

Same logic applies to say, a mongolian death worm, which I'd like to NOT damage players who make contact with it, but rather poison players who make contact. Is there any way to do this kind of stuff?

Edit: To anyone who asks for context, I'm talking in-battle.
I'm guessing I've stumped everyone with this too?
It's only a little over 24 hours since you posted (and please remember the rule about double posting!) and this is an international site with differing time zones. People will have a variety of sleep/work/leisure schedules. Also we are living in difficult times for many people. Please show a little patience.
Sorry; just a bit used to more prompt responses (under 24 hours iirc) before the forum layout changes.

Original thread: https://forums.rpgmakerweb.com/threads/contact-damage-and-status-effects-upon-contact.119462/