Executive Summary
While your heart is in the right place, sacrificing yourself to protect others from liability isn't a bright idea.
You are the one with the leverage here, and struggling to bail out a sinking ship will only hurt you in the long run.
Check Your Contract
You say you are a "consultant" and that they own rights to the software. Check to make sure you don't have any shares of the company, and are not otherwise liable for anything the business owners do.
Regardless of whether or not you acted as the face of the company, so long as you are not contractually obligated to the users directly, any losses or hardship they suffer is on the shoulders of the owners they signed the contract with.
If you do not understand your contract, or do not have a contract, or have a contract that was not thrown together and reviewed by a lawyer, it may be worthwhile to consult with an attorney to figure out your potential liability.
The point is you want to make sure that no matter what choice you make (staying or leaving), you are not responsible for any future mistakes the owners may make.
If You Leave, Avoid a Guilty Conscience
If you do decide to leave, be sure not to communicate it to the users in any way that may harm the company who owns the software. This answer may provide a bit more info on this part.
The point is that if you tell the users you are leaving and that you will no longer be supporting the software, you may be liable to the company for any damage to their business/reputation. I recommend not giving the owners any reason to screw you.
At the end of the day, it is the responsibility of the owners to handle this. Maybe clients will be unhappy, but they are not your clients, and if they were in the same situation, they would likely make the same choice. Working for free to do the owner's job is not something any rational client should expect from you.
If You Want to Stay, Negotiate
You are holding all the cards here. If you leave, they lose 100% of their revenues. After checking your contract, there is a possibility that there is no requirement for you to train a replacement. If they are being unreasonable, then you can take a hard line stance, and they are stuck holding the bag.
Here are some things you can try to negotiate:
Payment
If you are a pure developer, and they are on the business side, it makes no sense incentive-wise for your income to decrease because expenses are increasing faster than revenues. They are responsible for balancing new sales and expenses, and if they cannot increase sales at the current expense level, that is their responsibility as business owners.
You can negotiate this in several ways:
- Get a fixed salary rather than profit-sharing
- Change profit-sharing to revenue-sharing
- Mix a fixed-salary with revenue-sharing
Ownership
Currently they own the product, and you just maintain it. If you leave, and they're screwed, this gives you leverage to flip the business the other way. Offer to buy the product and have them get paid a portion of increased revenues (basically, make them get paid on commission as salespeople). This will increase your liability (since you will be responsible to the users with no cushion), but it will also give you more flexibility to run the business and treat the users as well as you feel is necessary.
Alternatively, if you can find a company that would like to purchase the product, you can negotiate a deal to work with them to maintain it if they buy out the current owners, meaning you would still be working for someone, but you would be able to renegotiate the conditions of employment and better your situation that way.
If expenses are increasing without revenues increasing significantly, that should not be your responsibility as a developer. You are not responsible for absorbing their lack of business ability. If they want to keep you, you can ask to be paid a fixed salary (which should be significant, as you are the only person who can do it), or to be paid a fixed salary plus a portion of profit sharing.
Ancillary Business
If you want to support the users but don't want to work for the owners, you can look in to creating your own business to support the software you wrote without owning it. This would still put money in to the pockets of the owners, but it would also give you a separate revenue stream.
If you want to create a spin-off business that creates add-ons or the like for these products, please check your contract carefully as well as consult a lawyer and checking what the policies for Facebook, etc. are for this type of activity. There is a good possibility it wouldn't be allowed, but it can't hurt to check.
Don't be Afraid to Walk Away
If they are unwilling to negotiate, they are the ones that get screwed. So don't be afraid to walk away. Give it an honest shot, but don't bend over backwards for people who aren't willing to bend their knees even one degree.
Lessons Learned
Whatever you decide, learn from your mistakes.
Beware Profit Sharing
Profit sharing works when you co-found a business. You have a seat at the decision-making table and an incentive to work to maintain the value of those shares. Profit sharing does not work well if you are a consultant, because you essentially foot the bill for the owners' expenses, and they have an incentive not to grow the business or manage expenses (especially if they are less-than-ethical and hire people in exchange for kickbacks or other favors).
Don't Sell Away Your Rights
If you are the only one who can do something, then don't sell away your rights. Keep ownership of your work, and license the right to use it. How different would this situation be if you had developed the product and sold them a license as the sole distributor each year? You could just revoke the license and sell it yourself if you're doing all the work.
Consult a Lawyer Early
It's all fun and games at the start. But when serious money starts moving hands, spend the money and consult an attorney. Make sure the contract is good and reflects your interests (while limiting your liability). If you don't and you get screwed, you have only yourself to blame.