According to the well established terminology concerning the energy level diagram of a materials that all energy levels are referenced to the vacuum level which is the free electron level for an electron level with zero kinetic energy. Then under this level, one finds the conduction band edge Ec ,which lies under the vacuum level by the electron affinity Xe,. Then under Ec is the valence band edge Ev. The difference between Ec and Ev is the energy gap of the material Eg= Ec - Ev
So, to the energy ban discontinuities between two materials, the most straight forward method is to align them to the vacuum level.
Making this for two materials say material 1 and 2, one can easily get the difference between the conduction ban edges Delta Ec = Ec2- Ec1= -X2 - ( -X1),
The difference in the valence band, the valence band discontinuity Delta Ev = Ev2- Ev1
= - X2 - Eg2- ( -X1- Eg1)= Delta Ec - (Eg2- Eg1)
According to this notation of the energy levels and comparing with your formula, it becomes clear that the core level Ecore is the conduction band edge Ec.
the formula you reported refers to what is usually done in computational chemistry, where 1s levels are taken as reference. This because it is easy to calculate them respect to other quatities.