How did kotoamatsukami, Genjutsu in existence, one of the most powerful Mangekyo techniques came to be? well one could wonder.

As it was never explained how mangekyo techniques come to be. But all that we know is that shisui was the wielder of this technique through his Mangekyo.  Now we will look on possible explanations on how he came to awaken it, as it was never revealead in the series. But I bet we might get a chance to see how, probably in Shinden fillers.