Add custom attribute to standard element from plugin
Another approach is to use the following event to attach a behavior

Event::on(Asset::class, Asset::EVENT_DEFINE_BEHAVIORS, 
function(DefineBehaviorsEvent $event) {
    $event-&gt;behaviors[] = MyBehavior::class;
});


The behavior could look like

class MyBehavior extends Behavior { 
    public $downloads; 
}


This way you won't receive an exception and can access your property via

$asset = Assets::find()-&gt;all();
$asset-&gt;downloads;


You can as well manipulate the value of downloads in the Behaviors init function in order to return the file or something like this