Limit the number of AI tokens a user can use in a day?

I kinda need per-user (not per-group) rate limits now, so am trying to roll my own interim solution. Limiting the number of prompts instead of tokens would be fine. I’m thinking of a webhook on post_event that says if it’s a PM and a user is posting to a bot, increment a custom field ‘ai_query_count’ on the user. I think that part would work.

Then what to do if the count gets too high? I tried some javascript in admin > customize > head that reads the user’s count and tries to disable the Reply button if the count is too high, but I can’t come up with a selector term to get the button.

Or maybe there’s a better approach. Any ideas are welcome!