Why are we subtracting -1 in Money Change Problem?

I understand that we need to subtract -1 because lower_bound by default gives a number that is greater than or equal to the number. But when we are explicitly using the custom comparator to return a number <= to the money then why are we subtracting -1 from the computation?

As we have changed our comparator function so that it works like upper bound. So it will always return index of that element whose value is greater than the needed value and to get the required value , we need to do -1.