you could try somehting like this:
add the attacker to a list per player, and clear the list when they are at full health.
this will however remember an assist even if it happened minutes ago but the player never went back to full health.
of you could ad an actual timer and remove it after a specified amount of time.
no idea if this code works as it is, might need some tweaking*
Code:
On damage of a player:
if attacker is a player:
add attacker's name to {assist::%attacked%::*}
on heal:
if event-entity is a player:
if event-entity's health is max health of event-entity:
clear {assist::%event-entity%::*}
on death of a player:
message "%event-player% was killed by %event-player's last attacker%. assisted by: %{assist::%event-entity%::*}%"
clear {assist::%event-entity%::*}
also note that the killer might be mentioned twice with this specific code. so do a rewrite.