How are stats stored on hive

are hive player stats stored by username?

(eg, if i change my name then someone takes my old name do they get my skywars level or do i get to keep it. or does nobody get my skywars level.)

Statistics, purchases etc are binded to your UUID, the account. Changing your gamertag will not affect your accounts statistics or purchases.