You have this line of code:
coins = localStorage.getItem('coins');
You don't want this line. What it does, is overwriting
coins
after
coins -= 100
with the old value from localStorage. You probably want this instead of getItem:
localStorage.setItem('coins', coins);