Little has gone as planned for Stanford this year.

Maybe that’s never been clearer than right now, as the Cardinal approach the final two weeks of the season needing two wins to qualify for just a middling bowl and likely will have their NFL prospect quarterback watching from the sideline.

“Part of the plan was that, after a heck of a year last year by K.J. Costello, he’d come back and break a bunch of records. That hasn’t happened,” Stanford head coach David Shaw said. “I thought that after he broke a bunch of records, then Davis (Mills) was going to try to break some of those records.”

Turns out, the record-breaking got fast-forwarded as the team’s record has hit a downward spiral.

Stanford (4-6) is in danger of snapping its program-best bowl streak at 10 seasons as Costello, the Pac-12’s leader in passing efficiency last season at 155.0, has been able to play only five games in 2019 because of a series of injuries.

He will miss Saturday’s Big Game and would require a remarkable recovery to play against Notre Dame on Nov. 30, according to Shaw. That leaves those games to Mills, who completed 33 of 50 passes for a school-record 504 yards Saturday at Washington State to give new hope to a team beset by injuries.

“Davis was exceptional,” Shaw said.

Behind an offensive line so beaten up that it moved a defensive player over, shifted a tight end down and signed a shot-put thrower off the track team, Mills broke Todd Husak’s mark of 450 passing yards set in 1998.

Trying to make up for a defense that yielded 624 yards, Mills was the first Stanford quarterback to throw for 400 yards since Andrew Luck in 2009.

“It’s pretty cool. It’s a record that hopefully will stay for a little while,” Mills said. “It’s cool to go down in the record books, but ultimately, it would have been nice to get a win.”

On Mills’ record-setting day, Stanford lost 49-22. That’s one of the reasons why Shaw thinks his sophomore might have played even better when he got his previous start against Washington more than a month ago.

On Oct. 5, Mills went 21-for-30 for 293 yards and a touchdown as the Cardinal upset then-No. 15 Washington 23-13.

“A quarterback’s No. 1 job is to take care of the football. As exceptional as 90% of that (record-setting) game was, those two turnovers hurt us,” Shaw said, comparing Mills’ two-interception performance against Washington State to his zero-turnover outing against Washington. “… It was a great game to look at and see that he’s much, much closer to his potential. I still don’t think he’s there yet. There’s still a lot more up there, and I’m excited for where he is and where he can be.”

At 6-foot-4 and 214 pounds, Mills looks the part. Plus, the sophomore has the credentials.

Saturday’s game Who: Cal (5-5, 2-5 Pac-12) vs. Stanford (4-6, 3-5) When: 1 p.m. Where: Stanford Stadium TV: Pac-12 Network Radio: 810, 104.5, 680, 1050

Read More

After throwing for 6,290 yards and 66 touchdowns and running for another 898 yards and 23 more scores at Greater Atlanta Christian, Mills was a consensus five-star recruit. He was considered the top quarterback in his class by Scout and Rivals and the best pro-style quarterback by 247 Sports.

Mills has been building his quiet confidence as he has observed Costello’s vocally impassioned version of leadership.

“Ultimately, as a leader, you have to be more hands-on, because leadership is a contact sport,” Mills said. “The only goals I have are to get wins the next two weeks.”

Rusty Simmons is a San Francisco Chronicle staff writer. Email: rsimmons@sfchronicle.com Twitter: @Rusty_SFChron