It’s all rooted in the CoreScripts. If you need a reference or some further resources to help you on trying to resolve this, I have the lines responsible for handling the unread chats notification bubble from the Topbar CoreScript:
You can trace things around. Took me a while of doing that, found that most things are internal. There might be a way to expose them directly on the Lua Chat System but I realise you don’t want forking so that’s out of the question.
This is a potential solution with the correct verification, however notifications don’t directly correspond with players chatting (e.g. notifications may not appear for filtered messages, the player themself, other specific criteria, etc) therefore isn’t ideal.