I’m not sure why the first time I’ve seen your post it didn’t click with me that I already wrote the command you’re asking for, you can easily adapt the code to your needs:
Sorry @Ritik_Ranjan, but your counters don’t communicate with each others, so that doesn’t really fit their needs.