Catalyzes three sequential steps of tetrahydrofolate biosynthesis. 7,8-dihydroneopterin = 6-hydroxymethyl-7,8-dihydropterin + glycolaldehyde 6-hydroxymethyl-7,8-dihydropterin + ATP = (7,8-dihydropterin-6-yl)methyl diphosphate + AMP + H(+) (7,8-dihydropterin-6-yl)methyl diphosphate + 4-aminobenzoate = 7,8-dihydropteroate + diphosphate Cofactor biosynthesis; tetrahydrofolate biosynthesis; 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine diphosphate from 7,8-dihydroneopterin triphosphate: step 3/4. Cofactor biosynthesis; tetrahydrofolate biosynthesis; 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine diphosphate from 7,8-dihydroneopterin triphosphate: step 4/4. Cofactor biosynthesis; tetrahydrofolate biosynthesis; 7,8-dihydrofolate from 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine diphosphate and 4-aminobenzoate: step 1/2. In the N-terminal section; belongs to the DHNA family. In the central section; belongs to the HPPK family. In the C-terminal section; belongs to the DHPS family.