make a phase 4 and 5 and make it so if I want to I can add display messages before the attack starts and it keep sthe sheild on so its like I can make them talk then the next phase starts happening. only in phase 4 and 5 keep the others good please. and make the whole thing

function cycleBossAttacks() {
    // Initialize the phase start time if it's not already set
    if (!phaseStartTime) {
        phaseStartTime = Date.now(); // Record the current time
        bossAttackPhase = 0; // Always start from phase 0 when the boss starts attacking
    }

    const currentTime = Date.now();
    const elapsedTime = currentTime - phaseStartTime; // Calculate elapsed time since start of boss phase

    if (bossHealth <= 0) { // Check if the boss is defeated
        if (!bossDefeatedMessageDisplayed) { // Check if the defeated message has not been displayed yet
            bossDefeatedMessageDisplayed = true; // Set flag to true to prevent future calls
        }
        return; // Exit function to prevent further actions if the boss is defeated
    }

    // Set the boss as attacking and shield it
    bossAttacking = true; 
    bossShielded = true; 
    boss.classList.add('boss-shielded'); 

    const maxBossMoves = (level === 1) ? 4 : (level === 2) ? 4 : 6; // Define number of moves for each level

    // Execute the appropriate attack based on the current boss attack phase
    switch (level) {
        case 1:
            switch (bossAttackPhase) {
                case 0:
                    bossEnemyBarrage(); // Standard attack for Level 1
                    break;
                case 1:
                    bossTargetSlam(); // Slam attack for Level 1
                    break;
                case 2:
                    bossNewPower(); // Unique attack for Level 1
                    break;
                case 3:
                    bossExplosionRain(); // Explosive attack for Level 1
                    break;
            }
            break;

        case 2:
            switch (bossAttackPhase) {
                case 0:
                    bossPhaseTwoBarrage(); // Different barrage for Level 2
                    break;
                case 1:
                    bossPhaseTwoTargetSlam(); // Unique slam for Level 2
                    break;
                case 2:
                    bossPhaseTwoNewPower(); // New attack for Level 2
                    break;
                case 3:
                    bossPhaseTwoExplosionRain(); // Explosion attack for Level 2
                    break;
            }
            break;

        case 3:
            // Only apply the elapsed time check for boss movels at phase 3
            if (bossAttackPhase === 0 && elapsedTime < 13000) {
                // Prevent boss move until 13000ms has passed
            startPhaseThree();
                return; // Exit and do not execute attacks
            }
            // If the time condition is met, proceed with boss's attack moves
            switch (bossAttackPhase) {
                case 0:
                    bossPhaseThree(); // Fourth attack action for Phase 3
                    break;
                case 1:
                    bossPhaseTwoExplosionRain2(); // First attack action for Phase 3
                    break;
                case 2:
                    bossPhaseTwoTargetSlam3(); // Second attack action for Phase 3
                    break;
                case 3:
                    bossPhaseTwoNewPower2(); // Third attack action for Phase 3
                    break;
                case 4:
                    bossPhaseTwoTargetSlam2(); // Fifth attack action for Phase 3
                    break;
                case 5:
                    bossPhase5(); // Fifth attack action for Phase 3
                    break;
            }
            break;

        case 4:
            // Only apply the elapsed time check for boss movels at phase 3
            if (bossAttackPhase === 0 && elapsedTime < 13000) {
                // Prevent boss move until 13000ms has passed
            startPhaseFour();
                return; // Exit and do not execute attacks
            }
            // If the time condition is met, proceed with boss's attack moves
            switch (bossAttackPhase) {
                case 0:
                    bossPhaseThree(); // Fourth attack action for Phase 3
                    break;
                case 1:
                    bossPhaseTwoExplosionRain2(); // First attack action for Phase 3
                    break;
                case 2:
                    bossPhaseTwoTargetSlam3(); // Second attack action for Phase 3
                    break;
                case 3:
                    bossPhaseTwoNewPower2(); // Third attack action for Phase 3
                    break;
                case 4:
                    bossPhaseTwoTargetSlam2(); // Fifth attack action for Phase 3
                    break;
                case 5:
                    bossPhase5(); // Fifth attack action for Phase 3
                    break;
            }
            break;
    }

    // Set a timeout to remove the shield effect after 5 seconds
    setTimeout(() => {
        bossShielded = false; // Allow boss damage after shielding
        boss.classList.remove('boss-shielded'); // Remove shield effect
        displayMessage("Boss shield is OFF! Attack now!"); // Inform players
    }, 5000); // Shield remains for 5 seconds

    // Increment the attack phase
    bossAttackPhase = (bossAttackPhase + 1) % maxBossMoves; // Cycle through boss moves
}