How do i put a food cooldown like the end cities fruit?

I'm trying to put a cooldown (like when you eat a fruit of the end, it appears like a white bar decreasing) Can someone tell me how?
Continue to help post