The Japanese authorities have zero tolerance for drug use - so my advice to you is don't do drugs in Japan.
Indeed, medications that are readily available over the counter (without a prescription) in countries like the USA or the UK, might contain substances that are banned altogether.
It you take medication on a regular basis it is best to check in advance of travel to see if anything you need to take with you conflicts with Japanese laws.
In 1980 Paul McCartney arrived at Narita International Airport, was arrested for cannabis possession, and was deported immediately. He was not able to enter Japan for the next ten years.
In 2010 Paris Hilton arrived at Narita International Airport and was refused entry into Japan due to a past drug case. She stayed overnight in the airport and returned to America the next day.
The lesson here is simple: don't do drugs in Japan.