A child’s mysterious and life-threatening illness was the result of her mother repeatedly drugging her for over a year, a judge has ruled.