A 13-year-old boy has been charged by counter terrorism detectives over an alleged plot to carry out violent acts at a school.