All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad (ﷺ) is His Slave and Messenger.
The answer to your question may be summarized as follows:
Firstly:
The days in which you deliberately broke your fast during Ramaḍān must all be made up (qaḍāʾ) according to the majority of scholars. You are not required to offer expiation (kaffārah) along with making up the fast, because expiation is only obligatory when the fast is broken through sexual intercourse. As for breaking the fast by eating, drinking, or similar actions, then only making up the fast is required, along with repentance to Allah.
Secondly:
Performing ghusl (ritual bathing) from major impurity—such as janābah or menstruation—is not a condition for the validity of fasting. Therefore, it is permissible for a person in a state of janābah to delay ghusl until after the break of dawn (fajr). However, ghusl is a condition for the validity of prayer, as is well known. Thus, your fast is not invalidated simply because you did not perform ghusl correctly.
Thirdly:
Regarding the days in which you engaged in that habit (masturbation) after reaching puberty:
If you were not certain that semen was discharged, then your fast is valid.
If you were certain that semen was discharged during the daytime in Ramaḍān, then your fast is invalid, and you must make up those days.
As for not performing ghusl correctly: the minimum valid ghusl that removes janābah is achieved by washing the entire body with water along with the intention of purification. If you did not perform this valid ghusl, then your state of janābah remained, and you must make up all the prayers that you performed while in that state, because purification is a condition for the validity of prayer.
Ignorance of how to perform the valid ghusl does not waive the obligation of making up the prayers, according to the majority of scholars. However, some scholars—including Shaykh al-Islām Ibn Taymiyyah
—held that if a person leaves a condition of prayer out of ignorance of its obligation, then they are not required to repeat it. Nevertheless, the first opinion is the one according to which we issue Fatwā.
You should not limit yourself to making up only one day’s prayers per day. The jurists have stated that the proper approach is a moderate one, and that it is sufficient to make up two days or more of prayers in a single day. Making up only one day per day is not sufficient unless you fear harm, such as neglecting your dependents if you were to do more.
Fourthly:
If you do not know the exact number of days or prayers you must make up, then you should estimate based on what you believe most likely clears your responsibility.
Allah Knows best.