Just with JS there is no way, because the visitor can reload the page or close window and reopen and reset everything.
You can create a table in your wordpress database where the user’s name will be saved with 0 (if no comments was done) and the id of the post (if commented). So in one more column, you create the replies number, starting with 0 and go increasing up to 3.
With JS you can access the database via AJAX requisitions, and add one more count of replies and when it’s 3, return a negative message.
This is the “JS way” that I see.
I Hope to help you.