You can store the data in web storage. What I usually do for waves, obstacles, etc... Set up a variable for the amount of time between waves (waveTime). I then setup a timer and have it use the waveTime variable to define how long the timer runs. For example every "waveTime" seconds do X. Where the magic comes in is that on X you decide what should happen. As the difficulty rises, etc... you can drop the waveTime variable down to decrease the amount of time between waves.
If you want to randomize your waves based on difficulty, create a variable called difficulty. When your timer runs you can do something like this:
Every "waveTime" seconds
-->If difficulty is 1 > Set enemyWave to Choose (a,b,c,d,e,f)
Then in your events you decide what enemies you want to spawn for a, b, c, etc... for example I could say:
if enemyWave = a > Spawn Red enemy
if enemyWave = b > Spawn Blue Enemy, etc... etc...
You do this for each difficulty 1, 2, 3, 4, 5, etc...
That gives you a very simple yet random game that adapts based on the difficulty and will also spawn multiple types of enemies so that the game does not get stale. And each difficulty you also decrease your waveTime variable so enemies come faster and faster as the difficulty rises.
You can also use the variable for difficulty or one for wavenumber and have the enemies health, speed, etc... go up based on them as well. That way even if they run into the same enemies they are more difficult to kill on higher waves, etc...