How can I automatically set inventory to zero after a countdown timer?

I am looking for a way to set a countdown timer on my site and once the timer counts down to 0, I would like the item inventory to automatically change to 0 marking the item as out of stock. I have already implemented a countdown timer, but everywhere I search I can only find apps to mark the item as a draft after a countdown, I do not want to do this, I want it to still be on the site, just marked as out of stock. Any help would be greatly appreciated. Thank you!