A study of the B+→KS0K+K-π+ and B+→KS0K+K+π- decays is performed using proton-proton collisions at center-of-mass energies of 7, 8 and 13 TeV at the LHCb experiment. The KS0Kπ invariant mass spectra from both decay modes reveal a rich content of charmonium resonances. New precise measurements of the ηc and ηc(2S) resonance parameters are performed and branching fraction measurements are obtained for B+ decays to ηc, J/ψ, ηc(2S) and χc1 resonances. In particular, the first observation and branching fraction measurement of B+→χc0K0π+ is reported as well as first measurements of the B+→K0K+K-π+ and B+→K0K+K+π- branching fractions. Dalitz plot analyses of ηc→KS0Kπ and ηc(2S)→KS0Kπ decays are performed. A new measurement of the amplitude and phase of the Kπ S-wave as functions of the Kπ mass is performed, together with measurements of the K0∗(1430), K0∗(1950) and a0(1700) parameters. Finally, the branching fractions of χc1 decays to K∗ resonances are also measured.