There are several ways to do this:
You can use the counter you're using now, divide the input before and multiply the output after the counter, only symmetrical up and down possible
You can use the Marbek way,
Or you create a loop with value connects one on the rising, one on the falling edge of your signal, where you add or subtract the values you want. you'll need to set limits: see Marbeks solution