Help with an equation using ApplyLinearImpulse

Hi all. First let me say thank you to the devs of this great library.

Second, can one of you physics gurus point me in the right direction to solve this.... In my app I have an ever increasing gravity (albeit slowly), and I have an object with an unchanging mass. Starting from the same rest point each time, I want to apply an impulse to the object that will make it reach the same height each time before gravity causes it to fall back down.

Example:
Gravity.Y is -2
A ball sits at point 0,0 and has a mass of 1.5
Impulse is applied and the ball makes it to point 0,100 before stopping due to the force of gravity
Ball falls back to 0,0

Gravity.y is increased to -4
Impulse is applied and the ball once again makes it to 0,100 before stopping due to the force of gravity
Ball falls back to 0,0


How do I calculate the impulse needed to do that? Thanks in advance!
*EDIT*

When I responded to this question I hadn't actually tried the method I suggested.
Now that I have actually tried it, I see that my post here had some mistakes.

See here for a better discussion on this kind of problem:
http://www.iforce2d.net/b2dtut/projected-trajectory
Thank you! I will try this later and see if I get what I am looking for. I currently just apply an amount of force plus the force of gravity * the weight of the object. It actually gets me pretty close to the value, but it does degrade over time.

Also, I chose 100 as a completely random number. 😉 Those are not the values I am using in game. They are obviously much smaller. Thanks again!

Original thread: https://box2d.org/forum/viewtopic.php?t=7535