Depends on what your aiming for.
JS v8 and all of the JIT have gotten pretty good. You could say unlimited. However there is a far better answer and a different way to look at the "how many globals is too many".
The answer is.
"Any more than what disrupts development, readibility and good development practices."
After a certain point you will need to keep better track of these globals where you don't need to. Sounds easy. is easy. but it's still over all lost time.
My personal global count max is 5.
I keep variables in Groups to object them. Groups always define an ES.
I also keep Dictionaries which store globals as an instance variable as Dictionaries are Global by nature.
When I use a true global it's development value. Such as
DebugLog string global. One where I will pop out a value to debug screen without the console window.
as for storing player info such as best time.
Dictionary.Add("BestTime_" & layoutname, timevariable)
and there you go. 1 global dictionary. stores thousands of levels(no need for global vars). And best of all you can also do. WebStorage.Add( "BestTimeSave", Dictionay.asJson ). To save all the data for later. Then use
Dictionary.FromJson( WebStoage.Get( "BestTimeSave"). boom smiple. only a few peice of code lines. and now you can support thousands of levels in only a few lines on a single ES.