let R = GetCommonData("Difficulty", 0); // Make a nice and short variable at the beginning of 
your script (or in an included file) and assign it to whatever determines your difficulty level. 
This'll reduce your boilerplate code by a decent amount. Ignoring everything outside of this snippet, 
the above statement will assign R to 0, as that's the default value of the common data as you can see.



let bulletCountArray = [10, 20, 30, 40]; // This variable holds an array which contains 
four elements, each corresponding to one of the four main difficulties.




let bulletCount = bulletCountArray[R]; // This variable holds the value at the index provided by the 
difficulty. Arrays are 0-indexed so since R has a value of 0, bulletCount will be assigned to 10--aka 
the first element in bulletCountArray.