You’re right, absolutely illegal. And it’s not like there aren’t ways to legally import your meds - it’s a matter of filling out a medicine import form and sending it to the nearest consulate before you leave to get permission. Of course there are meds that are plain illegal in Japan like certain decongestants. :(