well you need the condition like in the link:
on d pressed and is animation mona hit playing (reverted), this is important because it will limit the hits when you press d, in other words you will only hit when the animation is finished ,if you know what i mean, i dont know how explain it xD