A159: The cold damage is dependent on spell level, not on the amount of damage done to the temporary hit points. The spell is worded as "If a creature hits you with a melee attack while you have these hit points, the creature takes 5 cold damage" with the upcasting text specifying that both the number of hit points and the damage per hit scale with level.
In your specific example the Armor of Agathys retaliates for 25 cold damage.