Quote Fables:
I'm also the same, I've been yelled a far more times than I can count (doesn't help that I live in UK's Chav hotspot, Hull!) and people have thrown shit at me too.
Seriously? I'm studying in Hull right now and the chavs here are NICE compared to Doncaster, I've even had a few polite ones who've smiled at me. Could just be that I've dropped lucky in my three years being here though. o_O
Echoing what others have said, if you feel that you are in danger go some place safe like into a store for example. Safety is a priority. If you are in a situation in which you feel unsafe at all, remove yourself from it as quickly as possible. Don't put yourself in danger in an attempt to stand up to a group of people just to save face.
If you really feel you
must say something, simply respond with something alone the lines of, "Thats harassment and if you continue i'll take your photo and call the police." and leave it at that. Don't engage them or answer questions directed at you as it allows them to try and justify themselves to you. If push comes to shove and you do take a picture, you can show it to the police if they continue to bother you.
Also, don't loose your temper or swear at them. A lot of harassers want to get a rise out of you and by swearing at them or yelling abuse, they get what they want. Often totally ignoring them works really well. I did this recently to a group of really loud drunks who kept making lewd remarks and they just carry on and move on.
Sometimes you have to bite the bullet and leave your cosplay stuff at home though, or for bigger things like cons or recons held by your local Waterstones. As much as it sucks that you might have to dress down (because you should be free to wear what you like, within reason obviously), sometimes thre isn't much of an alternative. Or save your cosplay things for when you are in larger groups of friends, as that tends to keep chavs at bay.
Honestly though, think about where you are wearing cosplay items. Going into the middle of a crowded town centre is asking for trouble. Going past pubs in cosplay? asking for trouble. Wearing skimpy cosplay items in public? Asking for trouble. Sad, but true. Society doesn't work on fairness and equality, it works on
'The media/society says what you're wearing is weird, so I'm going to make fun of it/you.'
Take the time to think about where you're going to be wearing your cosplay items and prepare accordingly. For example, if you're going to a recon at Waterstones, put your cosplay on but cover it with a coat until you get inside the store.
Edit to add: Another technique which I use around groups of chavs and the like is if I see them from a distance, I casually cross the road. A lot of the time you can go by unnoticed.