Level * percent of hp missing / 10.
1 health left at level 1? It does 9 damage. Have it do 75% of that amount if they hit a wall, 50 if they hit another enemy, and 25 if they hit nothing.
Over complicated sure... but fun and has synergy with anything impact your hit points. Need more of that.