As he was in Mario's world, Masker, being the death god of that world, had a book with him, which was called a Death note which essentially allowed him to end someone's life by writing their name in it but one day he accidentally dropped it, letting it fall into the mortal world, and Mario soon found it and picked it up unaware of what it was and took it with him. Masker Mind had to follow to try and get his book back but it was no use, according to the rules of that book, the only way for Masker to get it back, was for Mario himself to die. And Masker is forced to follow him around, invisible to everyone else, until then
(Don't know if you ever saw it but there's an anime called Death Note that essentially has this same premise. This is a crossover of the two