3.P Tiered Gestalt Rules+How do prestige classes work?

When prestige classes advance the primary class features of their base class, they continue the CP cost progression of that base class.

For example, if a Wizard takes the Loremaster prestige class, then each level of the Loremaster class has the same CP cost as though the character had advanced in another level of Wizard.  This is because Loremaster advances spellcasting, the primary class feature of Wizards.  This includes any changes to the effective tier of the base class, as dictated by other options.

When a prestige class doesn't advance the primary features of a class, you instead price it as though it were a new base class of the appropriate tier.

For example, if the Dragon Disciple prestige class didn't advance spellcasting or grant ability score increases, it would be the equivalent of a tier 5 class.  So a Sorcerer taking her first level of Dragon Disciple would only need to pay 1 CP (or 2 CP if they've already taken three classes, see multiclassing above).  The next three levels advance spellcasting, so they'd cost the same CP as if she was taking additional levels of Sorcerer.  The 5th and 9th level also don't progress spellcasting, so she'd only need to pay 2 CP for each of those levels.  Ability score increases are handled separately, see the answer below.  She'd still be allowed to gestalt Sorcerer levels with those dead levels of Dragon Disciple (to retain full spellcasting progression), but in that case she'd pay both the CP cost for the Dragon Disciple and the Sorcerer (so 2 + 16 = 18 CP for the 5th and 9th levels).

Unlike in normal gestalt, dual-advancement prestige classes are allowed.  In this case, players must pay the CP cost for the progression in both base classes.  To determine this CP cost, you take the lesser of either the sum of both classes' CP cost, or the CP cost of one tier higher than your highest base class.

For example, a Wizard|Cleric -> Mystic Theurge would still need to pay the CP costs for both their Wizard and Cleric spellcasting advancement.  If they summed the CP costs for both they would exceed the CP allotment per level (24 + 24 > 24), delaying their spellcasting progression (by 20th level they'd end up with 13th level spellcasting in both Wizard and Cleric, with ~4 levels in another class).  However, by pricing the Mystic Theurge as a tier 0 class, they can maintain nearly a full spellcasting progression (with 18th level spellcasting in Wizard and Cleric at level 20).  Similarly, a Magus|Inquisitor -> Mystic Theurge would be able to complete their spellcasting progression and still have enough CPs for another full class (of tier 3 or lower).  An Eldritch Knight advancing Wizard and Fighter might choose to pay the sum of each class's CP cost (perhaps 24+3), rather than pricing it as a tier 0 class.

Sometimes it can be difficult to determine whether a prestige class advances the primary features of a class.  For example, is sneak attack the primary class feature of the Rogue?  Are bonus combat feats the primary class feature of the Fighter?  For this reason, the pricing of each prestige class is evaluated on a case-by-case basis.  Check with the GM to be sure.