Create a 24h timer in an string item

I didn’t get that from your answer. See Design Pattern : Expire Binding based Countdown timer and Design Pattern: Looping Timers. If wanting to use JS Scripting for your timer also see openHAB Rules Tools Announcements which has a countdown timer implemented as a library call.

At a high level, you need a Timer that triggers every so often (every second? every minute?) and updates an Item with the amount of time remaining.