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.
You should sincerely repent to Allah, seek His Forgiveness and perform good deeds as much as possible. In fact, masturbation is not only forbidden during Ramadan but it is forbidden at all times.
You should know that the masturbation that did not result in ejaculation does not annul the fast. Therefore, you should make up for all the days of Ramadan in which you masturbated and ejaculated.
Allah knows best.