Thank you for the reply, I'm sorry, that this did not work for you.
I forgot to mention which versions I've tested that with: online Twine2 2.2.1 in Firefox with Harlowe 2.1.0
For reproducing the code, I had 3 passages:
Start
Start Root
(print: $elapsedtime)
(print: $showoption)
StoryInit (tagged 'startup')
(set: $showoption to 1)
(set: $elapsedtime to 0)
F2 (tagged 'footer')
<!-- where to show the potion -->
|usehealpot>[]
<!-- when to display the health potion -->
(live: 1s)[(set: $elapsedtime to it + 1)]
(if: $elapsedtime is $showpotion)[
(replace: ?usehealpot)[
(link: "Drink i bit a health potion.")[
(if: $healpot < 1)[Your vials are empty!"]
(else:)[
(set: $hitpopints to it + 10)
(set: $healpots to it - 1)
(set: $showpotion to $elapsedtime + 10)]]]]
So when I create this in actual twinery.org/2
then 'play' works so far, as it shows
Start Root
0
1
Drink i bit a health potion.
without any delay. And after clicking on the link it turns to
Start Root
0
1
Your vials are empty!"
So I wonder whether you could reproduce this as it would prove that your code was useable with a few typos corrected only.
If it does not work, it might be of the different story versions 2-0-1 vs 2.1.0 ?