The origin of magic occurred very early on in the timeline of the universe. While you could argue that magic existed in the early years when time had not yet solidified, this would be better classified as simple chaos, not quite magic. Mario might have been able to throw fire balls, but there was little structure to his magical abilities. Magic as we know it didn’t arrive until several billion years later.