pit fiend xp question

I search for the answer but i didnt find it. Can i modify gate spell summoned pit fiends to give xp when they kill enemies ? Its okay that they are hostile, bit i want the xp for kills they do.
0
Comments
IF Killed(LastTargetedBy(Myself)) THEN RESPONSE #100 ActionOverride(LastSummonerOf(Myself),AddXPWorth(LastTargetedBy(Myself))) END
This is just a concept, you need to provide your own logic cause right now it'll keep giving xp to the summoner.
Enjoy
Edit: is there a way to format code? [code][/code] not working.