It is based on the average of your percentage scores for gen chem o chem and bio. With two 17's your 23 on gen chem (93% or so) was drastically reduced. I had a 19/20/23 and my total science was a 20. Everyone is in the same boat.
TS is scored as its own section consisting of 100 questions. According to the scoring chart in Barrons, an 18 represents you getting between 70 and 75 correct in this section.
Unlike your AA, the TS is NOT a weighted average and is scored just like any of the other sections on the exam.