GRASP package is based on the relativistic configuration interaction in which accurate calculations, accounting for valence, valence–valence, core–valence, core and core–core electron correlations, often rely on massive CSF expansions. This paper presents a further development of the method based on the second-order perturbation theory for finding the most important CSFs that have the greatest influence on the core–valence, core and core–core correlations. This method is based on a combination of the relativistic configuration interaction method and the stationary second-order Rayleigh–Schrödinger many-body perturbation theory in an irreducible tensorial form [G. Gaigalas, P. Rynkun, and L. Kitovienė, Second-order Rayleigh–Schrödinger perturbation theory for the GRASP2018 package: Core–valence correlations, Lith. J. Phys. 64(1), 20–39 (2024), https://doi.org/10.3952/physics.2024.64.1.3, and G. Gaigalas, P. Rynkun, and L. Kitovienė, Second-order Rayleigh–Schrödinger perturbation theory for the GRASP2018 package: Core correlations, Lith. J. Phys. 64(2), 73–81 (2024), https://doi.org/10.3952/physics.2024.64.2.1]. In this extension, the perturbation theory takes into account electron core–valence, core and core–core correlations, where an atom or ion has any number of valence electrons, for calculation of energy spectra and other properties. Meanwhile, the rest of the correlations are taken into account in a traditional way. This allows a significant reduction of the space of the configuration state function for complex atoms and ions. We also demonstrate how this method works for calculations of the energy structure and E1 transition properties of Fe XV ion.