Your function InputGetAxis will not always return a value. You need to have a return statement outside of your if statements so that if those conditions are not met it will return a value.
First thing about programming is learning to read the error messages and understanding methods that return values, they have to return a value of the applicable type.
The function above should get you working but I’ve no idea if it will give you the behaviour you expect as you have not made it clear what you are trying to do.