Well, how about that. I was just looking at the notetags, but that is what Turan was trying to get at. Anyway I appreciate the insistence of normalcy, Sword of Dusk.
So to recap if anyone comes across the same issue:
Using 'Melee' and 'Ranged' as elements should work for a "melee-only counter," by using Yanfly's Counter Control and putting
<Counter Condition>
Element: (ID of 'melee' element)
</Counter Condition>
In the Attack skill Note box. (Once I figured it out, I tried taking out that State notetag to see if it was even necessary, and it wasn't; it still works. Only needed the one above). Just set an ex-parameter to "counter attack + 100%" in the state for it and make sure the attack skill being countered isn't set to remove the state if it's not supposed to LOL!
And also that Yanfly plugins are in their correct order. I'm pretty sure it was still doing something weird even when attacked by a 'melee' enemy before I messed with the plugin order. Battle Engine was above Counter Control, and Core Engine was above Battle Engine, but other random stuff wasn't in the very specific recommended order, and once I put them in order it was only the 'ranged' that was acting up, which was fixed by making sure the attack didn't remove the state.