Update mercuryDoom.js

Fixed up this function and will test if it works.