Limit 'likes' against an integer and / or time period?

Hi all, so I’m watching this fantastic tutorial on the BF YT channel: https://youtu.be/RjRye1e0_hU?si=390G74aMlWPTLip4&t=435

It includes (linked) notes on how to limit to only one like per user, very easy to follow.
What I’m looking to do, though, is to have an integer in the post to control how many times a user can ‘like’ the post. Eg. If the integer ‘max_likes’ is 3, then the user can like it three times.

How would you recommend handling this?
Is it possible to also have a display of ‘x likes remaining’ (so if max_likes is 3 and they have liked once, then it will display ‘remaining likes: 2’)

And what if we wanted to limit to one-or-x likes per time period (eg. one use per week - or - three uses per month). Any suggestions here?

TIA!