The strong indicate that your dehydrated is your thick ejaculate. As you get your fluid levels back where they should be most of what you describe will correct itself. An over abundence of sugers will put you in a 'crash' loop. Also you did not mention if you are on any type of medication. Several meds dehydrate as well as directly interfere with libido, erection, & ejaculate.
Stress has a very significant impact on your overall day to day functions which not only encompasses your sex drive but even your restroom habits.
Make an appointment to see your doctor to check if you have anaemia, which can happen if you are not eating right.
Also ensure that you get enough sleep each night, eat a healthy and well balanced diet with fresh fruit and vegetables, cut down or cut out completely fizzy drinks that have caffeine in them like Coke and drink more milk (if you are not lactose intolerant) and water.
Getting dehydrated can cause headaches as can worry and stress and anxiety about an school work. Muscle cramps can indicate that you are not drinking enough and have lack of magnesium in your body.
If you eat correctly and get enough sleep and rest, things should improve.
A blood test would confirm if you have anaemia or diabetes (this can cause fatigue if your sugar levels are too high, you may also feel thirsty)
When you feel unwell all those symptoms that you mentioned can cause the problems with libido and erection and ejaculate problems. Do mention all your symptoms to your doctor.