I haven't actually tested it and am fairly new at modding, however I believe in order to deal damage you call the following:
EntityWeWantToDamage.damageEntity(DamageSource par1DamageSource, float par2);
Where EntityWeWantToDamage is replaced by whatever entity you're damaging, and par2 is the amount of damage dealt.