HUD in a loop cannot repeatedly access loop variable?

I'm trying to create a function that does an on-screen countdown using a HUD, but whatever combination of actions I try I only seem to see one HUD invocation with a value of 0, unless I leave out a delay in the loop. Then I see a very fast sequence of numbers.

This is based on the example loop in the documentation, except I note that does not actually display anything in the HUD.

If I can get that to work, I'm then not sure how I can make the loop run backwards, or update a different variable in the loop as n - loop for display.