Modded folding bike and strange chain skipping on most gears
With reference to the new/used bits of your question, note that using worn consumables (chain, cassette etc.) on a bike is never a good idea, largely because you're in the dark as regards how much life is left in them. So my best guess is that the chain or maybe both chain and the cassette needs replacing for new parts.

Assuming that these parts are actually ok, then the problem becomes one of poor mechanics. Two things spring to mind:

(1) the chain you used as a replacement is the wrong length, and/or
(2) you did not adjust the derailleurs correctly after your chain/cassette changes.

And are you sure you have fitted things to this bike which are compatible with those you removed?