I would say you need to be ready, waiting and expecting her to kick, and AS SOON AS she even flinches those muscles to begin her kick, she needs your hand smacking her rump, and not a tap either. She needs to KNOW that YOU are the boss, and it is NOT acceptable behavior. It may take a couple of times to establish that, but once you do, you should see much improvement. You can also reinforce it with loud, deep vocal correction at the same time you are swatting her butt.
One more thing, with her at least, DO NOT give her the bum scratches. I was also guilty of that over the years. Mine never kicked from it though. They would however, back up into me, asking for it. I was fine with it, but when people were here visiting out in the pasture, it is pretty unsettling when a horse backs up to you in that way.