How do i make a mob give an effect to whatever it attacks?

Trying to make it so certain mobs give you an effect when hit, regardlessof what they are holding
Continue to help post