There’s an easy way to do this!
Use a movement meter device, and set the meter to deplete the item that represents hunger…
Then, when it hits 0 (you can set it to transmit when it runs out), transmit on a channel that will activate a trigger loop connected to a damager.
To make it to where when they gain more hunger the damage stops, place a checker connected to another trigger loop that is infinite (set the trigger to no delay and attach it to a wire repeater device that signals at a 0 second interval), and when the checker checks they gain back the hunger item, make it transmit a channel in the “When check passes, transmit on” section that will stop the trigger loop.