From the info you have given the answer is no.
Gross vehicle weight rating is 18000
Gross combined weight is 21000
you have 18,000 plus 4000 = 22000 combined
1000 over the limit.
But what you really need to do is weigh the Motor home loaded for a trip and see what it really weighs.
The loaded weight of the motor home needs to be less than 17,400 with everyone and everything on board that you plan to take in the motor home.this includes your pet(s) and toothbrushes etc. Depending on what you tow there may well be 600 pounds tongue weight on the hitch which is why I say 17400
then you need to add the gross weight of the motor home to the gross weight of the trailer (etc) and that needs to be below 21000
NB; Correcting early error; the laden weight of the motor home has to be less than 17000 if what you are towing is 4000 pounds in order to stay under the 21000 Gross combined weight