Widaryanto said Williams obtained methamphetamine from a friend in Melbourne and has been using the drug since May 2014 and has used marijuana since she was 12.
"When the defendant is not using narcotics, the defendant feels tired, her body feels aching, itchy and always wants to consume narcotics," he told the court.
He said the last time she used methamphetamine was in a car in the car park at Melbourne Airport at about 4am on August 31 before boarding the flight to Bali.
He said Williams told Indonesian immigration officials she did not realise she was carrying methamphetamine because she was in a rush to get to the airport to fly to Bali after attending a party in Melbourne.
The maximum penalty for the possession of less than 5g of drugs carries a 12-years prison sentence, while importation has a maximum of 15 years.
Williams is due to return to court on March 30.
- AAP